From bc2b532a51aa8fe9bb71cce088b789bb38e9f7a0 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 21 Oct 2015 18:58:01 +0200 Subject: [PATCH] Add dmenu options to -h --- include/dialogs/dmenu.h | 1 + source/dialogs/dmenu.c | 33 +++++++++++++++++++++++++++++++++ source/rofi.c | 5 ++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/include/dialogs/dmenu.h b/include/dialogs/dmenu.h index 748587ec..ae0eefe9 100644 --- a/include/dialogs/dmenu.h +++ b/include/dialogs/dmenu.h @@ -8,4 +8,5 @@ */ int dmenu_switcher_dialog ( void ); +void print_dmenu_options ( void ); #endif diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c index b97d1dba..68b84efa 100644 --- a/source/dialogs/dmenu.c +++ b/source/dialogs/dmenu.c @@ -391,3 +391,36 @@ int dmenu_switcher_dialog ( void ) return retv; } +void print_dmenu_options ( void ) +{ + if ( isatty ( fileno ( stdout ) ) ) { + printf ( + "\t"color_bold "-mesg"color_reset + " [string] Print a small user message under the prompt (uses pango markup)\n" ); + printf ( "\t"color_bold "-p"color_reset " [string] Prompt to display left of entry field\n" ); + printf ( "\t"color_bold "-selected-row"color_reset " [integer] Select row\n" ); + printf ( "\t"color_bold "-format"color_reset " [string] Output format string\n" ); + printf ( "\t\t"color_italic "s"color_reset "\n" ); + printf ( "\t"color_bold "-u"color_reset " [list] List of row indexes to mark urgent\n" ); + printf ( "\t"color_bold "-a"color_reset " [list] List of row indexes to mark active\n" ); + printf ( "\t"color_bold "-l"color_reset " [integer] Number of rows to display\n" ); + printf ( "\t"color_bold "-i"color_reset " Set filter to be case insensitive\n" ); + printf ( "\t"color_bold "-only-match"color_reset " Force selection or custom entry\n" ); + printf ( "\t"color_bold "-no-custom"color_reset " Don't accept custom entry\n" ); + printf ( "\t"color_bold "-select"color_reset " [string] Select the first row that matches\n" ); + } + else { + printf ( "\t-mesg [string] Print a small user message under the prompt (uses pango markup)\n" ); + printf ( "\t-p [string] Prompt to display left of entry field\n" ); + printf ( "\t-selected-row [integer] Select row\n" ); + printf ( "\t-format [string] Output format string\n" ); + printf ( "\t\ts\n" ); + printf ( "\t-u [list] List of row indexes to mark urgent\n" ); + printf ( "\t-a [list] List of row indexes to mark active\n" ); + printf ( "\t-l [integer] Number of rows to display\n" ); + printf ( "\t-i Set filter to be case insensitive\n" ); + printf ( "\t-only-match Force selection or custom entry\n" ); + printf ( "\t-no-custom Don't accept custom entry\n" ); + printf ( "\t-select [string] Select the first row that matches\n" ); + } +} diff --git a/source/rofi.c b/source/rofi.c index 57c5b6ae..d68b640c 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1677,8 +1677,11 @@ static void help ( G_GNUC_UNUSED int argc, char **argv ) { printf ( "%s usage:\n", argv[0] ); printf ( "\t%s [-options ...]\n\n", argv[0] ); - printf ( "where options include:\n" ); + printf ( "Command line only options:\n" ); print_main_application_options (); + printf ( "DMENU command line options:\n" ); + print_dmenu_options (); + printf ( "Global options:\n" ); print_options (); printf ( "\n" ); printf ( "For more information see: man rofi\n" );