don't warn about using obsolete complete options

Fixes #3640
This commit is contained in:
Kurtis Rader 2017-01-09 11:21:34 -08:00
parent 4223b3da68
commit f365f720da
2 changed files with 6 additions and 17 deletions

View File

@ -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`').

View File

@ -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': {