diff --git a/libs/argv.c b/libs/argv.c index c95ab5f..7f173a3 100644 --- a/libs/argv.c +++ b/libs/argv.c @@ -237,3 +237,112 @@ readargs(int argc, char *argv[]) else usage(); } + +void +usage(void) +{ + fputs("spmenu: dynamic menu\n\n" + "- Arguments -\n" + "spmenu -l Set line count to stdin\n" + "spmenu -h Set spmenu line height to \n" + "spmenu -g Set the number of grids to \n" + "spmenu -gc Generate image cache\n" + "spmenu -rw Enable relative input width\n" + "spmenu -nrw Disable relative input width\n" + "spmenu -f Grabs keyboard before reading stdin\n" + "spmenu -F Enable fuzzy matching\n" + "spmenu -P Hide characters\n" + "spmenu -p Set spmenu prompt text to \n" + "spmenu -a Enable alpha\n" + "spmenu -na Disable alpha\n" + "spmenu -cp Color prompt\n" + "spmenu -ncp Don't color prompt\n" + "spmenu -tp Allow the user to type\n" + "spmenu -nt Don't allow typing, the user must select an option\n" + "spmenu -x Offset spmenu x position by \n" + "spmenu -y Offset spmenu y position by \n" + "spmenu -n Preselect in the list of items\n" + "spmenu -z Width of the spmenu window\n" + "spmenu -nmt Set normal mode text to \n" + "spmenu -imt Set insert mode text to \n" + "spmenu -bw Width of the border. 0 will disable the border\n" + "spmenu -s Use case-sensitive matching\n" + "spmenu -i Use case-insensitive matching\n" + "spmenu -nm Start spmenu in normal mode\n" + "spmenu -im Start spmenu in insert mode\n" + "spmenu -t Position spmenu at the top of the screen\n" + "spmenu -b Position spmenu at the bottom of the screen\n" + "spmenu -c Position spmenu at the center of the screen\n" + "spmenu -hm Hide mode indicator\n" + "spmenu -hmc Hide match count\n" + "spmenu -sm Show mode indicator\n" + "spmenu -smc Show match count\n" + "spmenu -xrdb Load .Xresources on runtime\n" + "spmenu -nxrdb Don't load .Xresources on runtime\n" + "spmenu -m Specify a monitor to run spmenu on\n" + "spmenu -w Embed spmenu inside \n" + "spmenu -H Specify a path to save the history to\n" + "spmenu -ig Set image gaps to \n" + "spmenu -lp Set the vertical padding\n" + "spmenu -hp Set the horizontal padding\n" + "spmenu -la Set the left arrow to \n" + "spmenu -ra Set the right arrow to \n" + "spmenu -is Image size\n" + "spmenu -it Position the image at the top\n" + "spmenu -ib Position the image at the bottom\n" + "spmenu -ic Position the image in the center\n" + "spmenu -itc Position the image in the top center\n" + "spmenu -wm Spawn spmenu as a window manager controlled client/window. Useful for testing\n" + "spmenu -v Print spmenu version to stdout\n" + "\n", stdout); + fputs("- Appearance arguments -\n" + "spmenu -fn Set the spmenu font to \n" + "spmenu -nif Set the normal item foreground color\n" + "spmenu -nib Set the normal item background color\n" + "spmenu -sif Set the selected item foreground color\n" + "spmenu -sib Set the selected item background color\n" + "spmenu -pfg Set the prompt foreground color\n" + "spmenu -pbg Set the prompt background color\n" + "spmenu -ifg Set input foreground color\n" + "spmenu -ibg Set input background color\n" + "spmenu -mbg Set the menu background color\n" + "spmenu -nhf Set the normal highlight foreground color\n" + "spmenu -nhb Set the normal highlight background color\n" + "spmenu -shf Set the selected highlight foreground color\n" + "spmenu -shb Set the selected highlight background color\n" + "spmenu -shb Set the selected highlight background color\n" + "spmenu -nfg Set the foreground color for the match count\n" + "spmenu -nbg Set the background color for the match count\n" + "spmenu -mfg Set the foreground color for the mode indicator\n" + "spmenu -mbg Set the background color for the mode indicator\n" + "spmenu -laf Set the left arrow foreground color\n" + "spmenu -raf Set the right arrow foreground color\n" + "spmenu -lab Set the left arrow background color\n" + "spmenu -rab Set the right arrow background color\n" + "spmenu -cc Set the caret color\n" + "spmenu -bc Set the border color\n" + "spmenu -sgr0 Set the SGR 0 color\n" + "spmenu -sgr1 Set the SGR 1 color\n" + "spmenu -sgr2 Set the SGR 2 color\n" + "spmenu -sgr3 Set the SGR 3 color\n" + "spmenu -sgr4 Set the SGR 4 color\n" + "spmenu -sgr5 Set the SGR 5 color\n" + "spmenu -sgr6 Set the SGR 6 color\n" + "spmenu -sgr7 Set the SGR 7 color\n" + "spmenu -sgr8 Set the SGR 8 color\n" + "spmenu -sgr9 Set the SGR 9 color\n" + "spmenu -sgr10 Set the SGR 10 color\n" + "spmenu -sgr11 Set the SGR 11 color\n" + "spmenu -sgr12 Set the SGR 12 color\n" + "spmenu -sgr13 Set the SGR 13 color\n" + "spmenu -sgr14 Set the SGR 14 color\n" + "spmenu -sgr15 Set the SGR 15 color\n" + "\n", stdout); + fputs("- dmenu compatibility -\n" + "spmenu -nb Set the normal background color\n" + "spmenu -nf Set the normal foreground color\n" + "spmenu -sb Set the selected background color\n" + "spmenu -sf Set the selected foreground color\n" + , stdout); + exit(1); +} diff --git a/libs/argv.h b/libs/argv.h index 04afc46..15282ba 100644 --- a/libs/argv.h +++ b/libs/argv.h @@ -1 +1,2 @@ static void readargs(int argc, char *argv[]); +static void usage(void); diff --git a/spmenu.c b/spmenu.c index c3a5c9c..2acdca7 100644 --- a/spmenu.c +++ b/spmenu.c @@ -1458,115 +1458,6 @@ setup(void) drawmenu(); } -void -usage(void) -{ - fputs("spmenu: dynamic menu\n\n" - "- Arguments -\n" - "spmenu -l Set line count to stdin\n" - "spmenu -h Set spmenu line height to \n" - "spmenu -g Set the number of grids to \n" - "spmenu -gc Generate image cache\n" - "spmenu -rw Enable relative input width\n" - "spmenu -nrw Disable relative input width\n" - "spmenu -f Grabs keyboard before reading stdin\n" - "spmenu -F Enable fuzzy matching\n" - "spmenu -P Hide characters\n" - "spmenu -p Set spmenu prompt text to \n" - "spmenu -a Enable alpha\n" - "spmenu -na Disable alpha\n" - "spmenu -cp Color prompt\n" - "spmenu -ncp Don't color prompt\n" - "spmenu -tp Allow the user to type\n" - "spmenu -nt Don't allow typing, the user must select an option\n" - "spmenu -x Offset spmenu x position by \n" - "spmenu -y Offset spmenu y position by \n" - "spmenu -n Preselect in the list of items\n" - "spmenu -z Width of the spmenu window\n" - "spmenu -nmt Set normal mode text to \n" - "spmenu -imt Set insert mode text to \n" - "spmenu -bw Width of the border. 0 will disable the border\n" - "spmenu -s Use case-sensitive matching\n" - "spmenu -i Use case-insensitive matching\n" - "spmenu -nm Start spmenu in normal mode\n" - "spmenu -im Start spmenu in insert mode\n" - "spmenu -t Position spmenu at the top of the screen\n" - "spmenu -b Position spmenu at the bottom of the screen\n" - "spmenu -c Position spmenu at the center of the screen\n" - "spmenu -hm Hide mode indicator\n" - "spmenu -hmc Hide match count\n" - "spmenu -sm Show mode indicator\n" - "spmenu -smc Show match count\n" - "spmenu -xrdb Load .Xresources on runtime\n" - "spmenu -nxrdb Don't load .Xresources on runtime\n" - "spmenu -m Specify a monitor to run spmenu on\n" - "spmenu -w Embed spmenu inside \n" - "spmenu -H Specify a path to save the history to\n" - "spmenu -ig Set image gaps to \n" - "spmenu -lp Set the vertical padding\n" - "spmenu -hp Set the horizontal padding\n" - "spmenu -la Set the left arrow to \n" - "spmenu -ra Set the right arrow to \n" - "spmenu -is Image size\n" - "spmenu -it Position the image at the top\n" - "spmenu -ib Position the image at the bottom\n" - "spmenu -ic Position the image in the center\n" - "spmenu -itc Position the image in the top center\n" - "spmenu -wm Spawn spmenu as a window manager controlled client/window. Useful for testing\n" - "spmenu -v Print spmenu version to stdout\n" - "\n", stdout); - fputs("- Appearance arguments -\n" - "spmenu -fn Set the spmenu font to \n" - "spmenu -nif Set the normal item foreground color\n" - "spmenu -nib Set the normal item background color\n" - "spmenu -sif Set the selected item foreground color\n" - "spmenu -sib Set the selected item background color\n" - "spmenu -pfg Set the prompt foreground color\n" - "spmenu -pbg Set the prompt background color\n" - "spmenu -ifg Set input foreground color\n" - "spmenu -ibg Set input background color\n" - "spmenu -mbg Set the menu background color\n" - "spmenu -nhf Set the normal highlight foreground color\n" - "spmenu -nhb Set the normal highlight background color\n" - "spmenu -shf Set the selected highlight foreground color\n" - "spmenu -shb Set the selected highlight background color\n" - "spmenu -shb Set the selected highlight background color\n" - "spmenu -nfg Set the foreground color for the match count\n" - "spmenu -nbg Set the background color for the match count\n" - "spmenu -mfg Set the foreground color for the mode indicator\n" - "spmenu -mbg Set the background color for the mode indicator\n" - "spmenu -laf Set the left arrow foreground color\n" - "spmenu -raf Set the right arrow foreground color\n" - "spmenu -lab Set the left arrow background color\n" - "spmenu -rab Set the right arrow background color\n" - "spmenu -cc Set the caret color\n" - "spmenu -bc Set the border color\n" - "spmenu -sgr0 Set the SGR 0 color\n" - "spmenu -sgr1 Set the SGR 1 color\n" - "spmenu -sgr2 Set the SGR 2 color\n" - "spmenu -sgr3 Set the SGR 3 color\n" - "spmenu -sgr4 Set the SGR 4 color\n" - "spmenu -sgr5 Set the SGR 5 color\n" - "spmenu -sgr6 Set the SGR 6 color\n" - "spmenu -sgr7 Set the SGR 7 color\n" - "spmenu -sgr8 Set the SGR 8 color\n" - "spmenu -sgr9 Set the SGR 9 color\n" - "spmenu -sgr10 Set the SGR 10 color\n" - "spmenu -sgr11 Set the SGR 11 color\n" - "spmenu -sgr12 Set the SGR 12 color\n" - "spmenu -sgr13 Set the SGR 13 color\n" - "spmenu -sgr14 Set the SGR 14 color\n" - "spmenu -sgr15 Set the SGR 15 color\n" - "\n", stdout); - fputs("- dmenu compatibility -\n" - "spmenu -nb Set the normal background color\n" - "spmenu -nf Set the normal foreground color\n" - "spmenu -sb Set the selected background color\n" - "spmenu -sf Set the selected foreground color\n" - , stdout); - exit(1); -} - int main(int argc, char *argv[]) {