From f365f720dafa305c5637720fd39009dfb52b3653 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Mon, 9 Jan 2017 11:21:34 -0800 Subject: [PATCH] don't warn about using obsolete complete options Fixes #3640 --- doc_src/complete.txt | 4 ++++ src/builtin_complete.cpp | 19 ++----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/doc_src/complete.txt b/doc_src/complete.txt index 0e6ee5d03..5a1a86fa7 100644 --- a/doc_src/complete.txt +++ b/doc_src/complete.txt @@ -61,6 +61,10 @@ the fish manual. - `-C` or `--do-complete` with no argument makes complete try to find all possible completions for the current command line buffer. If the shell is not in interactive mode, an error is returned. +- `-A` and `--authoritative` no longer do anything and are silently ignored. + +- `-u` and `--unauthoritative` no longer do anything and are silently ignored. + Command specific tab-completions in `fish` are based on the notion of options and arguments. An option is a parameter which begins with a hyphen, such as '`-h`', '`-help`' or '`--help`'. Arguments are parameters that do not begin with a hyphen. Fish recognizes three styles of options, the same styles as the GNU version of the getopt library. These styles are: - Short options, like '`-a`'. Short options are a single character long, are preceded by a single hyphen and may be grouped together (like '`-la`', which is equivalent to '`-l -a`'). Option arguments may be specified in the following parameter ('`-w 32`') or by appending the option with the value ('`-w32`'). diff --git a/src/builtin_complete.cpp b/src/builtin_complete.cpp index 286c09aa9..30fe087be 100644 --- a/src/builtin_complete.cpp +++ b/src/builtin_complete.cpp @@ -21,9 +21,6 @@ #include "wgetopt.h" #include "wutil.h" // IWYU pragma: keep -// This boolean ensures we only issue the warning about using the -A/--authoritative flag one time. -static bool authoritative_flag_warning = false; - // builtin_complete_* are a set of rather silly looping functions that make sure that all the proper // combinations of complete_add or complete_remove get called. This is needed since complete allows // you to specify multiple switches on a single commandline, like 'complete -s a -s b -s c', but the @@ -187,23 +184,11 @@ int builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t **argv) { break; } case 'u': { - if (!authoritative_flag_warning) { - streams.err.append_format( - _(L"%ls: Please update your completion scripts by removing " - L"-u / --unauthoritative / -A / --authoritative flags."), - cmd); - authoritative_flag_warning = true; - } + // This option was removed in commit 1911298 and is now a no-op. break; } case 'A': { - if (!authoritative_flag_warning) { - streams.err.append_format( - _(L"%ls: Please update your completion scripts by removing " - L"-u / --unauthoritative / -A / --authoritative flags."), - cmd); - authoritative_flag_warning = true; - } + // This option was removed in commit 1911298 and is now a no-op. break; } case 's': {