summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/options.c b/src/options.c
index 58f8fa0..e35402f 100644
--- a/src/options.c
+++ b/src/options.c
@@ -19,6 +19,7 @@ static const char *usage_str =
" -s, --show-scores Show the scores of each match\n"
" -0, --read-null Read input delimited by ASCII NUL characters\n"
" -j, --workers NUM Use NUM workers for searching. (default is # of CPUs)\n"
+ " -i, --show-info Show selection info line\n"
" -h, --help Display this help and exit\n"
" -v, --version Output version information and exit\n";
@@ -36,6 +37,7 @@ static struct option longopts[] = {{"show-matches", required_argument, NULL, 'e'
{"version", no_argument, NULL, 'v'},
{"benchmark", optional_argument, NULL, 'b'},
{"workers", required_argument, NULL, 'j'},
+ {"show-info", no_argument, NULL, 'i'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}};
@@ -51,13 +53,14 @@ void options_init(options_t *options) {
options->prompt = DEFAULT_PROMPT;
options->workers = DEFAULT_WORKERS;
options->input_delimiter = '\n';
+ options->show_info = DEFAULT_SHOW_INFO;
}
void options_parse(options_t *options, int argc, char *argv[]) {
options_init(options);
int c;
- while ((c = getopt_long(argc, argv, "vhs0e:q:l:t:p:j:", longopts, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "vhs0e:q:l:t:p:j:i", longopts, NULL)) != -1) {
switch (c) {
case 'v':
printf("%s " VERSION " © 2014-2018 John Hawthorn\n", argv[0]);
@@ -108,6 +111,9 @@ void options_parse(options_t *options, int argc, char *argv[]) {
}
options->num_lines = l;
} break;
+ case 'i':
+ options->show_info = 1;
+ break;
case 'h':
default:
usage(argv[0]);