Document/complete feature flags more

This commit is contained in:
Fabian Homborg 2018-09-16 10:39:15 +02:00
parent bda147c7d3
commit d44c21b580
3 changed files with 14 additions and 2 deletions

View file

@ -29,4 +29,6 @@ The following options are available:
- `-D` or `--debug-stack-frames=DEBUG_LEVEL` specify how many stack frames to display when debug messages are written. The default is zero. A value of 3 or 4 is usually sufficient to gain insight into how a given debug call was reached but you can specify a value up to 128.
- `-f` or `--features=FEATURES` enables one or more feature flags (separated by a comma). These are how fish stages changes that might break scripts.
The fish exit status is generally the exit status of the last foreground command. If fish is exiting because of a parse error, the exit status is 127.

View file

@ -16,6 +16,8 @@ status function
status line-number
status stack-trace
status job-control CONTROL-TYPE
status features
status test-feature FEATURE
\endfish
\subsection status-description Description
@ -47,9 +49,13 @@ The following operations (sub-commands) are available:
- `line-number` prints the line number of the currently running script. Also `current-line-number`, `-n` or `--current-line-number`.
- `stack-trace` prints a stack trace of all function calls on the call stack. Also `print-stack-trace`, `-t` or `--print-stack-trace`.
- `job-control CONTROL-TYPE` sets the job control type, which can be `none`, `full`, or `interactive`. Also `-j CONTROL-TYPE` or `--job-control=CONTROL-TYPE`.
- `stack-trace` prints a stack trace of all function calls on the call stack. Also `print-stack-trace`, `-t` or `--print-stack-trace`.
- `features` lists all available feature flags.
- `test-feature FEATURE` returns 0 when FEATURE is enabled, 1 if it is disabled, and 2 if it is not recognized.
\subsection status-notes Notes

View file

@ -1,5 +1,5 @@
# Note that when a completion file is sourced a new block scope is created so `set -l` works.
set -l __fish_status_all_commands is-login is-interactive is-block is-breakpoint is-command-substitution is-no-job-control is-interactive-job-control is-full-job-control current-filename current-line-number print-stack-trace job-control
set -l __fish_status_all_commands is-login is-interactive is-block is-breakpoint is-command-substitution is-no-job-control is-interactive-job-control is-full-job-control current-filename current-line-number print-stack-trace job-control features test-feature
# These are the recognized flags.
complete -c status -s h -l help -d "Display help and exit"
@ -24,3 +24,7 @@ complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_com
complete -f -c status -n "__fish_seen_subcommand_from job-control" -a full -d "Set all jobs under job control"
complete -f -c status -n "__fish_seen_subcommand_from job-control" -a interactive -d "Set only interactive jobs under job control"
complete -f -c status -n "__fish_seen_subcommand_from job-control" -a none -d "Set no jobs under job control"
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a features -d "List all feature flags"
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a test-feature -d "Test if a feature flag is enabled"
complete -f -c status -n "__fish_seen_subcommand_from test-feature" -a '(status features)'