Add shortcuts for selection and version options in xclip#150
Add shortcuts for selection and version options in xclip#150erikd234 wants to merge 2 commits intoastrand:masterfrom
Conversation
This commit introduces two new command-line shortcuts for the xclip utility. The '-s' shortcut has been added for the '--selection' option, allowing users to specify the X selection (primary, clipboard, secondary, or buffer-cut) more conveniently. Additionally, the '-v' shortcut for '--version' has been implemented, making it easier to check the version of xclip. The help message in xcprint.c has been updated accordingly to reflect these new shortcuts.
|
Thanks for the pull request, Erik! I'm surprised -sel is not in the short help. Perhaps that is because xclip, like many X applications, allows any option to be abbreviated as long as it is unique. My tab completion on xclip -sTab shows That means if xclip ever adds a -selfie options, for example, -sel would stop working and the documentation mentioning it would need to be changed. While I like your proposal, I'm against using A while ago I made a pull request for a version which provided By the way, editing the short help is not enough when changing command line options. The man page and the tab completion should also be updated. |
|
Thanks, I thougth about the man page but I coudnlt find the man entry in the code base. I see what your saying about -c. But -s fits with the other shortcuts (although -s could also be -silent) At the very least we should add -sel to the help menu and man page. (and the info about c,s,p,b) |
|
Hi @erikd234! I'm helping @astrand with some maintenance of xclip, I've brought your PR up to date with master. If you're still interested in getting this merged, would you be up for updating the man page ( I've got no issues w/ |
This commit introduces two new command-line shortcuts for the xclip utility. The '-s' shortcut has been added for the '--selection'
option, allowing users to specify the X selection (primary, clipboard, secondary, or buffer-cut) more conveniently. Additionally, the
'-v' shortcut for '--version' has been implemented, making it easier to check the version of xclip. The help message in xcprint.c has
been updated accordingly to reflect these new shortcuts.
Also I added in the help command the short forms of the differetn selection targets (p, s, c , and b)
If you want me to update the to also use -s I can, manual testing works and the tests pass after changes.