Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions xclip.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "xclib.h"

/* command line option table for XrmParseCommand() */
XrmOptionDescRec opt_tab[18];
XrmOptionDescRec opt_tab[20];
int opt_tab_size;

/* Options that get set on the command line */
Expand Down Expand Up @@ -802,7 +802,6 @@ main(int argc, char *argv[])
/* Declare variables */
Window win; /* Window */
int exit_code;

/* As a convenience to command-line users, default to -o if stdin
* is a tty. Will be overridden by -i or if user specifies a
* filename as input.
Expand Down Expand Up @@ -841,6 +840,13 @@ main(int argc, char *argv[])
opt_tab[i].value = (XPointer) NULL;
i++;

/* selection option shortcut */
opt_tab[i].option = xcstrdup("-s");
opt_tab[i].specifier = xcstrdup(".selection");
opt_tab[i].argKind = XrmoptionSepArg;
opt_tab[i].value = (XPointer) NULL;
i++;

/* filter option entry */
opt_tab[i].option = xcstrdup("-filter");
opt_tab[i].specifier = xcstrdup(".filter");
Expand Down Expand Up @@ -869,6 +875,13 @@ main(int argc, char *argv[])
opt_tab[i].value = (XPointer) xcstrdup("V");
i++;

/* version option shortcut*/
opt_tab[i].option = xcstrdup("-v");
opt_tab[i].specifier = xcstrdup(".print");
opt_tab[i].argKind = XrmoptionNoArg;
opt_tab[i].value = (XPointer) xcstrdup("V");
i++;

/* help option entry */
opt_tab[i].option = xcstrdup("-help");
opt_tab[i].specifier = xcstrdup(".print");
Expand Down
4 changes: 2 additions & 2 deletions xcprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ prhelp(char *name)
" -i, -in read text into X selection from stdin or files [DEFAULT]\n"
" -f, -filter text piped in to selection will also be printed out\n"
" -o, -out prints the selection to standard out\n"
" -selection primary [DEFAULT], clipboard, secondary, or buffer-cut\n"
" -s, -selection primary [DEFAULT], clipboard, secondary, or buffer-cut (p, c, s or b)\n"
" -t, -target specify target atom: image/jpeg, UTF8_STRING [DEFAULT]\n"
" -alt-text specify text representation for STRING target\n"
" -silent errors only, (run in background) [DEFAULT]\n"
Expand All @@ -51,7 +51,7 @@ prhelp(char *name)
" -noutf8 don't treat text as utf-8, use old unicode\n"
" -r, -rmlastnl remove the last newline character if present\n"
" -d, -display X display to connect to (eg localhost:0\")\n"
" -version version information\n"
" -v -version version information\n"
" -h, -help this usage information\n"
"\n" "Report bugs to <[email protected]>\n", name);
exit(EXIT_SUCCESS);
Expand Down