Permalink
Browse files

don't warn about using obsolete complete options

Fixes #3640
  • Loading branch information...
1 parent 4223b3d commit f365f720dafa305c5637720fd39009dfb52b3653 @krader1961 krader1961 committed Jan 9, 2017
Showing with 6 additions and 17 deletions.
  1. +4 −0 doc_src/complete.txt
  2. +2 −17 src/builtin_complete.cpp
@@ -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`').
@@ -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': {

0 comments on commit f365f72

Please sign in to comment.