5 ms·
Published my first crate today, and I'm awaiting all your suggestions. The "zp" command is a custom command that takes one argument, which is the name of the s
by bohemianjock 4y ago
Published my first crate today, and I'm awaiting all your suggestions.
The "zp" command is a custom command that takes one argument, which is the name of the source file. The purpose of this command is to copy the contents of the source file to the clipboard, allowing users to easily paste the contents into another file or program.
To use the "zp" command, simply open your terminal or command prompt and type "zp" followed by the name of the source file. For example:
`zp myFile.txt`
This will copy the contents of "myFile.txt" to the clipboard.
The "zp" command is particularly useful for quickly copying text or data from one file to another without having to manually select and copy the text. This can save time and effort, especially when working with large or complex files.
- pipo234 4y agoSo this is essentially just a thin wrapper around cli-clipboard? Read file contents and then `cli_clipboard::set_contents(contents.to_owned())` (<-- Magic goes here)?
- bohemianjock 4y agoThat's right!
- pipo234 4y agoWell it compiles, that's good. Has some rough edges in terms of CLI ergonomics (panics if file not found) and does not appear to actually put stuff on the clipboard (ubuntu 22 x11, wayland). Also have a look at edge cases like `zp /dev/null`, `zp /dev/stdout`. And in a CLI context I typically would like to be able to read/write to pipe as in `echo | zp`. edit: And what about copying from clipboard (to file)?
- bohemianjock 4y agoHey, thank you for the suggestions. I just started learning rust and wanted to build something (useful) to learn more about it and the entire lifecycle of building something with it. Will definetly take your suggestions and add more features in the coming days!
- pipo234 4y agoHave fun!
- bohemianjock 4y agoHeyy, just released v0.2.0! It works for linux now!