From bda97e08499cbe73fdbc2a93a3bd97bd60fcd797 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 16 Feb 2015 09:07:05 +0100 Subject: [PATCH] Throw a warning when using old commandline arguments. * Give error on -now, -rnow, -snow, -key, -skey, -rkey * Update manpage. --- doc/rofi-manpage.markdown | 18 ++---------------- doc/rofi.1 | 36 ++++++------------------------------ source/helper.c | 12 ++++++++++++ source/rofi.c | 4 +++- 4 files changed, 23 insertions(+), 47 deletions(-) diff --git a/doc/rofi-manpage.markdown b/doc/rofi-manpage.markdown index 41e8931a..a748d911 100644 --- a/doc/rofi-manpage.markdown +++ b/doc/rofi-manpage.markdown @@ -59,27 +59,13 @@ MIT/X11 **rofi** can be used in two ways, single-shot; executes once and directly exits when done or as daemon listening to specific key-combinations. -The default key combinations are: - -* `F12` - - Show all windows on all desktops. - -* `mod1-F2` - - Show run-dialog. - -* `mod1-F3` - - Show ssh-dialog. - ## OPTIONS -`-key-**mode**` **KEY** +`-key-{mode}` **KEY** - Change the key combination to display a **mode** + Set the key combination to display a {mode} in daemon mode. rofi -key-run F12 diff --git a/doc/rofi.1 b/doc/rofi.1 index eda894c9..4295d3df 100644 --- a/doc/rofi.1 +++ b/doc/rofi.1 @@ -53,31 +53,11 @@ MIT/X11 .PP \fBrofi\fP can be used in two ways, single\-shot; executes once and directly exits when done or as daemon listening to specific key\-combinations. -.PP -The default key combinations are: -.RS -.IP \(bu 2 -\fB\fCF12\fR -.RE -.PP - Show all windows on all desktops. -.RS -.IP \(bu 2 -\fB\fCmod1\-F2\fR -.RE -.PP - Show run\-dialog. -.RS -.IP \(bu 2 -\fB\fCmod1\-F3\fR -.RE -.PP - Show ssh\-dialog. .SH OPTIONS .PP -\fB\fC\-key\-**mode**\fR \fBKEY\fP +\fB\fC\-key\-{mode}\fR \fBKEY\fP .IP -Change the key combination to display a \fBmode\fP +Set the key combination to display a {mode} in daemon mode. .PP .RS .nf @@ -605,18 +585,14 @@ Check quotes used on the commandline: e.g. used “ instead of ". .SH WEBSITE .PP \fBrofi\fP website can be found at here -.UR https://davedavenport.github.io/rofi/ -.UE +\[la]https://davedavenport.github.io/rofi/\[ra] .PP \fBrofi\fP bugtracker can be found here -.UR https://github.com/DaveDavenport/rofi/issues -.UE +\[la]https://github.com/DaveDavenport/rofi/issues\[ra] .SH AUTHOR .PP Qball Cow -.MT qball@gmpclient.org -.ME +\[la]qball@gmpclient.org\[ra] .PP Original code based on work by: Sean Pringle -.MT sean.pringle@gmail.com -.ME +\[la]sean.pringle@gmail.com\[ra] diff --git a/source/helper.c b/source/helper.c index 57de94e1..d81d537e 100644 --- a/source/helper.c +++ b/source/helper.c @@ -407,6 +407,18 @@ void create_pid_file ( const char *pidfile ) void config_parse_cmd_options ( int argc, char ** argv ) { + if ( find_arg ( argc, argv, "-rnow") >= 0 || + find_arg ( argc, argv, "-snow") >= 0 || + find_arg ( argc, argv, "-now") >= 0 || + find_arg ( argc, argv, "-key") >= 0 || + find_arg ( argc, argv, "-skey") >= 0 || + find_arg ( argc, argv, "-rkey") >= 0 ) { + fprintf(stderr, "The -snow, -now, -rnow, -key, -rkey, -skey are deprecated " + "and have been removed.\n" + "Please see the manpage: %s -help for the correct syntax.", argv[0]); + exit(EXIT_FAILURE); + } + find_arg_str ( argc, argv, "-switchers", &( config.switchers ) ); // Parse commandline arguments about the looks. find_arg_uint ( argc, argv, "-opacity", &( config.window_opacity ) ); diff --git a/source/rofi.c b/source/rofi.c index f2d2c04b..106802c0 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -547,7 +547,9 @@ inline static void menu_nav_down ( MenuState *state ) * @param key the Key to match * @param modstate the modifier state to match * - * Return the index of the switcher that matches the key combination + * Match key and modifier state against switchers. + * + * @return the index of the switcher that matches the key combination * specified by key and modstate. Returns -1 if none was found */ extern unsigned int NumlockMask;