Undunder __fish_is_nth_token

We keep __fish_is_nth_token for compatibility and edit the
implementations of __fish_is_nth_token, __fish_is_first_token and
__fish_is_token_n to use fish_is_nth_token
This commit is contained in:
Aniruddh Agarwal 2021-06-29 20:26:49 -04:00 committed by Fabian Homborg
parent 859edc9c2c
commit 0445126c2e
35 changed files with 172 additions and 181 deletions

View file

@ -62163,7 +62163,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -62165,7 +62165,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "Test if current token is on Nth place" msgstr "Test if current token is on Nth place"

View file

@ -64769,7 +64769,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "Vérifier si le dossier actuel est un dépôt git" msgstr "Vérifier si le dossier actuel est un dépôt git"
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -61917,7 +61917,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -61918,7 +61918,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -61940,7 +61940,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -87073,7 +87073,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -57723,8 +57723,8 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
#: share/functions/__fish_is_token_n.fish:1 #: share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -61916,7 +61916,7 @@ msgstr ""
msgid "Check if the current directory is a git repository" msgid "Check if the current directory is a git repository"
msgstr "" msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_is_token_n.fish:1 #: /tmp/fish/implicit/share/functions/fish_is_nth_token.fish:1
msgid "Test if current token is on Nth place" msgid "Test if current token is on Nth place"
msgstr "" msgstr ""

View file

@ -270,4 +270,4 @@ set -l aws_services \
workspaces \ workspaces \
xray xray
complete -c aws -n __fish_is_first_token -xa "$aws_services" complete -c aws -n "fish_is_nth_token 1" -xa "$aws_services"

View file

@ -64,7 +64,7 @@ for k,v in data["dependencies"].items(): print(k + "\t" + v[:18])' <bower.json 2
jq -r '.dependencies | to_entries[] | .key' bower.json jq -r '.dependencies | to_entries[] | .key' bower.json
end end
complete -c bower -n __fish_is_first_token -x -a '(__bower_cmds)' complete -c bower -n "fish_is_nth_token 1" -x -a '(__bower_cmds)'
complete -c bower -n __fish_should_complete_switches -x -a '(__bower_args)' complete -c bower -n __fish_should_complete_switches -x -a '(__bower_args)'
complete -c bower -n "__fish_seen_subcommand_from install" -x -a '(__bower_matching_pkgs)' complete -c bower -n "__fish_seen_subcommand_from install" -x -a '(__bower_matching_pkgs)'
complete -c bower -n "__fish_seen_subcommand_from uninstall" -x -a '(__bower_list_installed)' complete -c bower -n "__fish_seen_subcommand_from uninstall" -x -a '(__bower_list_installed)'

View file

@ -2,4 +2,4 @@
set -l commands aam apm attrib cmd debug defects devlist eject epc format fwdownload help hpa identify idle inquiry load modepage negotiate opcodes periphlist persist readcap reportluns reprobe rescan reset sanitize security sleep smpcmd smpmaninfo smppc smpphylist smprg standby start stop tags timestamp tur zone set -l commands aam apm attrib cmd debug defects devlist eject epc format fwdownload help hpa identify idle inquiry load modepage negotiate opcodes periphlist persist readcap reportluns reprobe rescan reset sanitize security sleep smpcmd smpmaninfo smppc smpphylist smprg standby start stop tags timestamp tur zone
complete -c camcontrol -n __fish_is_first_token -xa "$commands" complete -c camcontrol -n "fish_is_nth_token 1" -xa "$commands"

View file

@ -5,28 +5,28 @@ complete -c cygport -s 8 -l 64 -d "Build for 64-bit Cygwin"
complete -c cygport -l debug -d "Enable debugging messages" complete -c cygport -l debug -d "Enable debugging messages"
# Cygport file # Cygport file
complete -c cygport -n __fish_is_first_token -f -a '*.cygport' -d "Cygport file" complete -c cygport -n "fish_is_nth_token 1" -f -a '*.cygport' -d "Cygport file"
# Commands # Commands
complete -c cygport -n 'not __fish_is_first_token' -f -a 'downloadall fetchall wgetall getall' -d "Download all sources" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'downloadall fetchall wgetall getall' -d "Download all sources"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'download fetch wget get' -d "Download missing sources" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'download fetch wget get' -d "Download missing sources"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'prep unpack' -d "Prepare source directory" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'prep unpack' -d "Prepare source directory"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'compile build make' -d "Build software" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'compile build make' -d "Build software"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'check test' -d "Run test suite" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'check test' -d "Run test suite"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'inst install' -d "Install into DESTDIR and run post-installation steps" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'inst install' -d "Install into DESTDIR and run post-installation steps"
complete -c cygport -n 'not __fish_is_first_token' -f -a postinst -d "Run post-installation steps" complete -c cygport -n 'not fish_is_nth_token 1' -f -a postinst -d "Run post-installation steps"
complete -c cygport -n 'not __fish_is_first_token' -f -a list -d "List package files" complete -c cygport -n 'not fish_is_nth_token 1' -f -a list -d "List package files"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'listdebug listdbg' -d "List debug package files" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'listdebug listdbg' -d "List debug package files"
complete -c cygport -n 'not __fish_is_first_token' -f -a dep -d "Show dependencies" complete -c cygport -n 'not fish_is_nth_token 1' -f -a dep -d "Show dependencies"
complete -c cygport -n 'not __fish_is_first_token' -f -a info -d "Show packaging info" complete -c cygport -n 'not fish_is_nth_token 1' -f -a info -d "Show packaging info"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'homepage web www' -d "Show project homepage URL" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'homepage web www' -d "Show project homepage URL"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'package-test pkg-test' -d "Create packages, marked as test" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'package-test pkg-test' -d "Create packages, marked as test"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'package pkg' -d "Create packages" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'package pkg' -d "Create packages"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'diff mkdiff mkpatch' -d "Create source patches" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'diff mkdiff mkpatch' -d "Create source patches"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'upload up' -d "Upload finished packages" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'upload up' -d "Upload finished packages"
complete -c cygport -n 'not __fish_is_first_token' -f -a stage -d "Upload packages without marking !ready" complete -c cygport -n 'not fish_is_nth_token 1' -f -a stage -d "Upload packages without marking !ready"
complete -c cygport -n 'not __fish_is_first_token' -f -a announce -d "Send announcement email" complete -c cygport -n 'not fish_is_nth_token 1' -f -a announce -d "Send announcement email"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'clean finish' -d "Delete working directory" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'clean finish' -d "Delete working directory"
complete -c cygport -n 'not __fish_is_first_token' -f -a 'almostall all' -d "Same as prep build inst pkg" complete -c cygport -n 'not fish_is_nth_token 1' -f -a 'almostall all' -d "Same as prep build inst pkg"
complete -c cygport -n 'not __fish_is_first_token' -f -a help -d "Show help" complete -c cygport -n 'not fish_is_nth_token 1' -f -a help -d "Show help"
complete -c cygport -n 'not __fish_is_first_token' -f -a version -d "Show version" complete -c cygport -n 'not fish_is_nth_token 1' -f -a version -d "Show version"

View file

@ -1,24 +1,24 @@
# First parameter is the profile name, or 'usage' # First parameter is the profile name, or 'usage'
complete -c duply -f -n __fish_is_first_token - '(set -l files /etc/duply/* ~/.duply/*; string replace -r ".*/" "" -- $files)' -d Profile complete -c duply -f -n "fish_is_nth_token 1" - '(set -l files /etc/duply/* ~/.duply/*; string replace -r ".*/" "" -- $files)' -d Profile
complete --command duply --no-files --arguments usage -d 'Get usage help text' complete --command duply --no-files --arguments usage -d 'Get usage help text'
# Second parameter is a duply command # Second parameter is a duply command
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments create -d 'Creates a configuration profile' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments create -d 'Creates a configuration profile'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments backup -d 'Backup with pre/post script execution' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments backup -d 'Backup with pre/post script execution'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments bkp -d 'Backup without executing pre/post scripts' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments bkp -d 'Backup without executing pre/post scripts'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments pre -d 'Execute <profile>/pre script' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments pre -d 'Execute <profile>/pre script'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments post -d 'Execute <profile>/post script' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments post -d 'Execute <profile>/post script'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments full -d 'Force full backup' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments full -d 'Force full backup'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments incr -d 'Force incremental backup' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments incr -d 'Force incremental backup'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments list -d 'List all files in backup (as it was at <age>, default: now)' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments list -d 'List all files in backup (as it was at <age>, default: now)'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments status -d 'Prints backup sets and chains currently in repository' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments status -d 'Prints backup sets and chains currently in repository'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments verify -d 'List files changed since latest backup' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments verify -d 'List files changed since latest backup'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments purge -d 'Shows outdated backup archives [--force, delete these files]' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments purge -d 'Shows outdated backup archives [--force, delete these files]'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments purge-full -d 'Shows outdated backups [--force, delete these files]' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments purge-full -d 'Shows outdated backups [--force, delete these files]'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments cleanup -d 'Shows broken backup archives [--force, delete these files]' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments cleanup -d 'Shows broken backup archives [--force, delete these files]'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments restore -d 'Restore the backup to <target_path> [as it was at <age>]' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments restore -d 'Restore the backup to <target_path> [as it was at <age>]'
complete --command duply --no-files --condition 'not __fish_is_first_token' --arguments fetch -d 'Restore single file/folder from backup [as it was at <age>]' complete --command duply --no-files --condition 'not fish_is_nth_token 1' --arguments fetch -d 'Restore single file/folder from backup [as it was at <age>]'
# Options # Options
complete --command duply --no-files --long-option force -d 'Really execute the commands: purge, purge-full, cleanup' complete --command duply --no-files --long-option force -d 'Really execute the commands: purge, purge-full, cleanup'

View file

@ -2043,7 +2043,7 @@ complete -F -c git -n '__fish_git_using_command config' -l blob -d 'Read config
# If no argument is specified, it's as if --get was used # If no argument is specified, it's as if --get was used
# Use -k with `__fish_git_config_keys` so that user defined valeus are shown first # Use -k with `__fish_git_config_keys` so that user defined valeus are shown first
complete -c git -n '__fish_git_using_command config; and __fish_is_token_n 3' -kfa '(__fish_git_config_keys)' complete -c git -n '__fish_git_using_command config; and fish_is_nth_token 3' -kfa '(__fish_git_config_keys)'
complete -f -c git -n '__fish_git_using_command config; and __fish_is_first_arg' -l get -d 'Get config with name' -kra '(__fish_git_config_keys)' complete -f -c git -n '__fish_git_using_command config; and __fish_is_first_arg' -l get -d 'Get config with name' -kra '(__fish_git_config_keys)'
complete -f -c git -n '__fish_git_using_command config' -l get -d 'Get config with name' -kra '(__fish_git_config_keys)' complete -f -c git -n '__fish_git_using_command config' -l get -d 'Get config with name' -kra '(__fish_git_config_keys)'
complete -f -c git -n '__fish_git_using_command config' -l get-all -d 'Get all values matching key' -ka '(__fish_git_config_keys)' complete -f -c git -n '__fish_git_using_command config' -l get-all -d 'Get all values matching key' -ka '(__fish_git_config_keys)'

View file

@ -49,4 +49,4 @@ complete -c meson -l cross-file -r -d "File describing cross-compilation environ
complete -c meson -l wrap-mode -xa 'WrapMode.{default,nofallback,nodownload,forcefallback}' -d "Special wrap mode to use" complete -c meson -l wrap-mode -xa 'WrapMode.{default,nofallback,nodownload,forcefallback}' -d "Special wrap mode to use"
# final parameter # final parameter
complete -c meson -n __fish_is_first_token -xa '(__fish_complete_directories)' complete -c meson -n "fish_is_nth_token 1" -xa '(__fish_complete_directories)'

View file

@ -16,8 +16,8 @@ complete -c python -o vv -d "Even more verbose mode"
complete -c python -s V -l version -d "Display version and exit" complete -c python -s V -l version -d "Display version and exit"
complete -c python -s W -x -d "Warning control" -a "ignore default all module once error" complete -c python -s W -x -d "Warning control" -a "ignore default all module once error"
complete -c python -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd' complete -c python -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
complete -c python -f -n __fish_is_first_token -k -a "(__fish_complete_suffix .py)" complete -c python -f -n "fish_is_nth_token 1" -k -a "(__fish_complete_suffix .py)"
complete -c python -f -n __fish_is_first_token -a - -d 'Read program from stdin' complete -c python -f -n "fish_is_nth_token 1" -a - -d 'Read program from stdin'
# Version-specific completions # Version-specific completions
# We have to detect this at runtime because pyenv etc can change # We have to detect this at runtime because pyenv etc can change

View file

@ -13,8 +13,8 @@ complete -c python2 -s v -d "Verbose mode"
complete -c python2 -s V -d "Display version and exit" complete -c python2 -s V -d "Display version and exit"
complete -c python2 -s W -x -d "Warning control" -a "ignore default all module once error" complete -c python2 -s W -x -d "Warning control" -a "ignore default all module once error"
complete -c python2 -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd' complete -c python2 -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
complete -c python2 -f -n __fish_is_first_token -k -a "(__fish_complete_suffix .py)" complete -c python2 -f -n "fish_is_nth_token 1" -k -a "(__fish_complete_suffix .py)"
complete -c python2 -f -n __fish_is_first_token -a - -d 'Read program from stdin' complete -c python2 -f -n "fish_is_nth_token 1" -a - -d 'Read program from stdin'
complete -c python2 -s 3 -d 'Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix' complete -c python2 -s 3 -d 'Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix'
complete -c python2 -s t -d "Warn on mixed tabs and spaces" complete -c python2 -s t -d "Warn on mixed tabs and spaces"
complete -c python2 -s Q -x -a "old new warn warnall" -d "Division control" complete -c python2 -s Q -x -a "old new warn warnall" -d "Division control"

View file

@ -13,8 +13,8 @@ complete -c python3 -s v -d "Verbose mode"
complete -c python3 -s V -l version -d "Display version and exit" complete -c python3 -s V -l version -d "Display version and exit"
complete -c python3 -s W -x -d "Warning control" -a "ignore default all module once error" complete -c python3 -s W -x -d "Warning control" -a "ignore default all module once error"
complete -c python3 -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd' complete -c python3 -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
complete -c python3 -n __fish_is_first_token -k -fa "(__fish_complete_suffix .py)" complete -c python3 -n "fish_is_nth_token 1" -k -fa "(__fish_complete_suffix .py)"
complete -c python3 -f -n __fish_is_first_token -a - -d 'Read program from stdin' complete -c python3 -f -n "fish_is_nth_token 1" -a - -d 'Read program from stdin'
complete -c python3 -s q -d 'Don\'t print version and copyright messages on interactive startup' complete -c python3 -s q -d 'Don\'t print version and copyright messages on interactive startup'
complete -c python3 -s X -x -d 'Set implementation-specific option' -a 'faulthandler showrefcount tracemalloc showalloccount importtime dev utf8 pycache_prefex=PATH:' complete -c python3 -s X -x -d 'Set implementation-specific option' -a 'faulthandler showrefcount tracemalloc showalloccount importtime dev utf8 pycache_prefex=PATH:'
complete -c python3 -s b -d 'Issue warnings for possible misuse of `bytes` with `str`' complete -c python3 -s b -d 'Issue warnings for possible misuse of `bytes` with `str`'

View file

@ -230,7 +230,7 @@ complete -c rustup -n __fish_should_complete_switches -s v -l verbose
complete -c rustup -n __fish_should_complete_switches -s h -l help complete -c rustup -n __fish_should_complete_switches -s h -l help
complete -c rustup -n __fish_should_complete_switches -s V -l version complete -c rustup -n __fish_should_complete_switches -s V -l version
complete -c rustup -n __fish_is_first_token -xa "$subcmds" complete -c rustup -n "fish_is_nth_token 1" -xa "$subcmds"
complete -c rustup -n "__fish_prev_arg_in default" -xa "$__rustup_toolchains_short $__rustup_toolchains" complete -c rustup -n "__fish_prev_arg_in default" -xa "$__rustup_toolchains_short $__rustup_toolchains"
complete -c rustup -n "__fish_prev_arg_in toolchain" -xa "add install list remove uninstall link help" complete -c rustup -n "__fish_prev_arg_in toolchain" -xa "add install list remove uninstall link help"

View file

@ -13,49 +13,49 @@ complete -c s3cmd -f -n __s3cmd_is_valid_remote_path -a "(s3cmd ls (commandline
complete -c s3cmd -f -n __s3cmd_is_remote_path complete -c s3cmd -f -n __s3cmd_is_remote_path
# Suppress file completions for initial command # Suppress file completions for initial command
complete -c s3cmd -n __fish_is_first_token -f complete -c s3cmd -n "fish_is_nth_token 1" -f
# Available commands # Available commands
complete -c s3cmd -n __fish_is_first_token -a mb -d 'Make bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a mb -d 'Make bucket'
complete -c s3cmd -n __fish_is_first_token -a rb -d 'Remove bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a rb -d 'Remove bucket'
complete -c s3cmd -n __fish_is_first_token -a ls -d 'List objects or buckets' complete -c s3cmd -n "fish_is_nth_token 1" -a ls -d 'List objects or buckets'
complete -c s3cmd -n __fish_is_first_token -a la -d 'List all object in all buckets' complete -c s3cmd -n "fish_is_nth_token 1" -a la -d 'List all object in all buckets'
complete -c s3cmd -n __fish_is_first_token -a put -d 'Put file into bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a put -d 'Put file into bucket'
complete -c s3cmd -n __fish_is_first_token -a get -d 'Get file from bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a get -d 'Get file from bucket'
complete -c s3cmd -n __fish_is_first_token -a del -d 'Delete file from bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a del -d 'Delete file from bucket'
complete -c s3cmd -n __fish_is_first_token -a rm -d 'Delete file from bucket (alias for del)' complete -c s3cmd -n "fish_is_nth_token 1" -a rm -d 'Delete file from bucket (alias for del)'
complete -c s3cmd -n __fish_is_first_token -a restore -d 'Restore file from Glacier storage' complete -c s3cmd -n "fish_is_nth_token 1" -a restore -d 'Restore file from Glacier storage'
complete -c s3cmd -n __fish_is_first_token -a sync -d 'Synchronize a directory tree to S3' complete -c s3cmd -n "fish_is_nth_token 1" -a sync -d 'Synchronize a directory tree to S3'
complete -c s3cmd -n __fish_is_first_token -a du -d 'Disk usage by buckets' complete -c s3cmd -n "fish_is_nth_token 1" -a du -d 'Disk usage by buckets'
complete -c s3cmd -n __fish_is_first_token -a info -d 'Get various information about Buckets or Files' complete -c s3cmd -n "fish_is_nth_token 1" -a info -d 'Get various information about Buckets or Files'
complete -c s3cmd -n __fish_is_first_token -a cp -d 'Copy object' complete -c s3cmd -n "fish_is_nth_token 1" -a cp -d 'Copy object'
complete -c s3cmd -n __fish_is_first_token -a modify -d 'Modify object metadata' complete -c s3cmd -n "fish_is_nth_token 1" -a modify -d 'Modify object metadata'
complete -c s3cmd -n __fish_is_first_token -a mv -d 'Move object' complete -c s3cmd -n "fish_is_nth_token 1" -a mv -d 'Move object'
complete -c s3cmd -n __fish_is_first_token -a setacl -d 'Modify Access control list for Bucket or Files' complete -c s3cmd -n "fish_is_nth_token 1" -a setacl -d 'Modify Access control list for Bucket or Files'
complete -c s3cmd -n __fish_is_first_token -a setpolicy -d 'Modify Bucket Policy' complete -c s3cmd -n "fish_is_nth_token 1" -a setpolicy -d 'Modify Bucket Policy'
complete -c s3cmd -n __fish_is_first_token -a delpolicy -d 'Delete Bucket Policy' complete -c s3cmd -n "fish_is_nth_token 1" -a delpolicy -d 'Delete Bucket Policy'
complete -c s3cmd -n __fish_is_first_token -a setcors -d 'Modify Bucket CORS' complete -c s3cmd -n "fish_is_nth_token 1" -a setcors -d 'Modify Bucket CORS'
complete -c s3cmd -n __fish_is_first_token -a delcors -d 'Delete Bucket CORS' complete -c s3cmd -n "fish_is_nth_token 1" -a delcors -d 'Delete Bucket CORS'
complete -c s3cmd -n __fish_is_first_token -a payer -d 'Modify Bucket Requester Pays policy' complete -c s3cmd -n "fish_is_nth_token 1" -a payer -d 'Modify Bucket Requester Pays policy'
complete -c s3cmd -n __fish_is_first_token -a multipart -d 'Show multipart uploads' complete -c s3cmd -n "fish_is_nth_token 1" -a multipart -d 'Show multipart uploads'
complete -c s3cmd -n __fish_is_first_token -a abortmp -d 'Abort a multipart upload' complete -c s3cmd -n "fish_is_nth_token 1" -a abortmp -d 'Abort a multipart upload'
complete -c s3cmd -n __fish_is_first_token -a listmp -d 'List parts of a multipart upload' complete -c s3cmd -n "fish_is_nth_token 1" -a listmp -d 'List parts of a multipart upload'
complete -c s3cmd -n __fish_is_first_token -a accesslog -d 'Enable/disable bucket access logging' complete -c s3cmd -n "fish_is_nth_token 1" -a accesslog -d 'Enable/disable bucket access logging'
complete -c s3cmd -n __fish_is_first_token -a sign -d 'Sign arbitrary string using the secret key' complete -c s3cmd -n "fish_is_nth_token 1" -a sign -d 'Sign arbitrary string using the secret key'
complete -c s3cmd -n __fish_is_first_token -a signurl -d 'Sign an S3 URL to provide limited public access with expiry' complete -c s3cmd -n "fish_is_nth_token 1" -a signurl -d 'Sign an S3 URL to provide limited public access with expiry'
complete -c s3cmd -n __fish_is_first_token -a fixbucket -d 'Fix invalid file names in a bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a fixbucket -d 'Fix invalid file names in a bucket'
complete -c s3cmd -n __fish_is_first_token -a ws-create -d 'Create Website from bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a ws-create -d 'Create Website from bucket'
complete -c s3cmd -n __fish_is_first_token -a ws-delete -d 'Delete Website' complete -c s3cmd -n "fish_is_nth_token 1" -a ws-delete -d 'Delete Website'
complete -c s3cmd -n __fish_is_first_token -a ws-info -d 'Info about Website' complete -c s3cmd -n "fish_is_nth_token 1" -a ws-info -d 'Info about Website'
complete -c s3cmd -n __fish_is_first_token -a expire -d 'Set or delete expiration rule for the bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a expire -d 'Set or delete expiration rule for the bucket'
complete -c s3cmd -n __fish_is_first_token -a setlifecycle -d 'Upload a lifecycle policy for the bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a setlifecycle -d 'Upload a lifecycle policy for the bucket'
complete -c s3cmd -n __fish_is_first_token -a dellifecycle -d 'Remove a lifecycle policy for the bucket' complete -c s3cmd -n "fish_is_nth_token 1" -a dellifecycle -d 'Remove a lifecycle policy for the bucket'
complete -c s3cmd -n __fish_is_first_token -a cflist -d 'List CloudFront distribution points' complete -c s3cmd -n "fish_is_nth_token 1" -a cflist -d 'List CloudFront distribution points'
complete -c s3cmd -n __fish_is_first_token -a cfinfo -d 'Display CloudFront distribution point parameters' complete -c s3cmd -n "fish_is_nth_token 1" -a cfinfo -d 'Display CloudFront distribution point parameters'
complete -c s3cmd -n __fish_is_first_token -a cfcreate -d 'Create CloudFront distribution point' complete -c s3cmd -n "fish_is_nth_token 1" -a cfcreate -d 'Create CloudFront distribution point'
complete -c s3cmd -n __fish_is_first_token -a cfdelete -d 'Delete CloudFront distribution point' complete -c s3cmd -n "fish_is_nth_token 1" -a cfdelete -d 'Delete CloudFront distribution point'
complete -c s3cmd -n __fish_is_first_token -a cfmodify -d 'Change CloudFront distribution point parameters' complete -c s3cmd -n "fish_is_nth_token 1" -a cfmodify -d 'Change CloudFront distribution point parameters'
complete -c s3cmd -n __fish_is_first_token -a cfinvalinfo -d 'Display CloudFront invalidation request(s) status' complete -c s3cmd -n "fish_is_nth_token 1" -a cfinvalinfo -d 'Display CloudFront invalidation request(s) status'
# Created against s3cmd version 2.0 # Created against s3cmd version 2.0
complete -c s3cmd -s h -l help -d 'Show help and exit' complete -c s3cmd -s h -l help -d 'Show help and exit'

View file

@ -1,16 +1,16 @@
# First argument is the names of the service, i.e. a file in /etc/init.d # First argument is the names of the service, i.e. a file in /etc/init.d
complete -c service -n __fish_is_first_token -xa "(__fish_print_service_names)" -d Service complete -c service -n "fish_is_nth_token 1" -xa "(__fish_print_service_names)" -d Service
# as found in __fish_print_service_names.fish # as found in __fish_print_service_names.fish
if test -d /run/systemd/system # Systemd systems if test -d /run/systemd/system # Systemd systems
complete -c service -n "not __fish_is_first_token" -xa "start stop restart status enable disable" complete -c service -n 'not fish_is_nth_token 1' -xa "start stop restart status enable disable"
else if type -f rc-service 2>/dev/null # OpenRC (Gentoo) else if type -f rc-service 2>/dev/null # OpenRC (Gentoo)
complete -c service -n "not __fish_is_first_token" -xa "start stop restart" complete -c service -n 'not fish_is_nth_token 1' -xa "start stop restart"
else if test -d /etc/init.d # SysV on Debian and other linuxen else if test -d /etc/init.d # SysV on Debian and other linuxen
complete -c service -n "not __fish_is_first_token" -xa "start stop --full-restart" complete -c service -n 'not fish_is_nth_token 1' -xa "start stop --full-restart"
else # FreeBSD else # FreeBSD
# Use the output of `service -v foo` to retrieve the list of service-specific verbs # Use the output of `service -v foo` to retrieve the list of service-specific verbs
complete -c service -n "not __fish_is_first_token" -xa "(__fish_complete_freebsd_service_actions)" complete -c service -n 'not fish_is_nth_token 1' -xa "(__fish_complete_freebsd_service_actions)"
end end
function __fish_complete_freebsd_service_actions function __fish_complete_freebsd_service_actions

View file

@ -66,35 +66,35 @@ end
# #
# Regular switches, set only accepts these before the variable name, # Regular switches, set only accepts these before the variable name,
# so we need to test using __fish_is_first_token # so we need to test using "fish_is_nth_token 1"
complete -c set -n __fish_is_first_token -s e -l erase -d "Erase variable" complete -c set -n "fish_is_nth_token 1" -s e -l erase -d "Erase variable"
complete -c set -n __fish_is_first_token -s x -l export -d "Export variable to subprocess" complete -c set -n "fish_is_nth_token 1" -s x -l export -d "Export variable to subprocess"
complete -c set -n __fish_is_first_token -s u -l unexport -d "Do not export variable to subprocess" complete -c set -n "fish_is_nth_token 1" -s u -l unexport -d "Do not export variable to subprocess"
complete -c set -n __fish_is_first_token -s g -l global -d "Make variable scope global" complete -c set -n "fish_is_nth_token 1" -s g -l global -d "Make variable scope global"
complete -c set -n __fish_is_first_token -s l -l local -d "Make variable scope local" complete -c set -n "fish_is_nth_token 1" -s l -l local -d "Make variable scope local"
complete -c set -n __fish_is_first_token -s U -l universal -d "Share variable persistently across sessions" complete -c set -n "fish_is_nth_token 1" -s U -l universal -d "Share variable persistently across sessions"
complete -c set -n __fish_is_first_token -s q -l query -d "Test if variable is defined" complete -c set -n "fish_is_nth_token 1" -s q -l query -d "Test if variable is defined"
complete -c set -n __fish_is_first_token -s h -l help -d "Display help and exit" complete -c set -n "fish_is_nth_token 1" -s h -l help -d "Display help and exit"
complete -c set -n __fish_is_first_token -s n -l names -d "List the names of the variables, but not their value" complete -c set -n "fish_is_nth_token 1" -s n -l names -d "List the names of the variables, but not their value"
complete -c set -n __fish_is_first_token -s a -l append -d "Append value to a list" complete -c set -n "fish_is_nth_token 1" -s a -l append -d "Append value to a list"
complete -c set -n __fish_is_first_token -s p -l prepend -d "Prepend value to a list" complete -c set -n "fish_is_nth_token 1" -s p -l prepend -d "Prepend value to a list"
complete -c set -n __fish_is_first_token -s S -l show -d "Show variable" complete -c set -n "fish_is_nth_token 1" -s S -l show -d "Show variable"
complete -c set -n __fish_is_first_token -l path -d "Make variable as a path variable" complete -c set -n "fish_is_nth_token 1" -l path -d "Make variable as a path variable"
complete -c set -n __fish_is_first_token -l unpath -d "Make variable not as a path variable" complete -c set -n "fish_is_nth_token 1" -l unpath -d "Make variable not as a path variable"
#TODO: add CPP code to generate list of read-only variables and exclude them from the following completions #TODO: add CPP code to generate list of read-only variables and exclude them from the following completions
# Complete using preexisting variable names # Complete using preexisting variable names
complete -c set -n '__fish_is_first_token; and not __fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s g -s U -l local -l global -l universal' -x -a "(set -l | string match -rv '^__' | string replace ' ' \t'Local Variable: ')" complete -c set -n '"fish_is_nth_token 1"; and not __fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s g -s U -l local -l global -l universal' -x -a "(set -l | string match -rv '^__' | string replace ' ' \t'Local Variable: ')"
complete -c set -n '__fish_is_first_token; and not __fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s g -s U -l local -l global -l universal' -x -a "(set -g | string match -rv '^__' | string replace ' ' \t'Global Variable: ')" complete -c set -n '"fish_is_nth_token 1"; and not __fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s g -s U -l local -l global -l universal' -x -a "(set -g | string match -rv '^__' | string replace ' ' \t'Global Variable: ')"
complete -c set -n '__fish_is_first_token; and not __fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s g -s U -l local -l global -l universal' -x -a "(set -U | string match -rv '^__' | string replace ' ' \t'Universal Variable: ')" complete -c set -n '"fish_is_nth_token 1"; and not __fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s g -s U -l local -l global -l universal' -x -a "(set -U | string match -rv '^__' | string replace ' ' \t'Universal Variable: ')"
# Complete some fish configuration variables even if they aren't set. # Complete some fish configuration variables even if they aren't set.
complete -c set -n '__fish_is_first_token; and not __fish_seen_argument -s e -l erase' -x -a "(__fish_set_special_vars)" complete -c set -n '"fish_is_nth_token 1"; and not __fish_seen_argument -s e -l erase' -x -a "(__fish_set_special_vars)"
# Complete scope-specific variables # Complete scope-specific variables
complete -c set -n '__fish_is_first_token; and __fish_seen_argument -s l -l local' -x -a "(set -l | string replace ' ' \t'Local Variable: ')" complete -c set -n '"fish_is_nth_token 1"; and __fish_seen_argument -s l -l local' -x -a "(set -l | string replace ' ' \t'Local Variable: ')"
complete -c set -n '__fish_is_first_token; and __fish_seen_argument -s g -l global' -x -a "(set -g | string replace ' ' \t'Global Variable: ')" complete -c set -n '"fish_is_nth_token 1"; and __fish_seen_argument -s g -l global' -x -a "(set -g | string replace ' ' \t'Global Variable: ')"
complete -c set -n '__fish_is_first_token; and __fish_seen_argument -s U -l universal' -x -a "(set -U | string replace ' ' \t'Universal Variable: ')" complete -c set -n '"fish_is_nth_token 1"; and __fish_seen_argument -s U -l universal' -x -a "(set -U | string replace ' ' \t'Universal Variable: ')"
# Complete using preexisting variable names for `set --erase` # Complete using preexisting variable names for `set --erase`
complete -c set -n '__fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s U -s g -l local -l global -l Universal' -f -a "(set -g | string replace ' ' \tGlobal\ Variable:\ )" complete -c set -n '__fish_seen_argument -s e -l erase; and not __fish_seen_argument -s l -s U -s g -l local -l global -l Universal' -f -a "(set -g | string replace ' ' \tGlobal\ Variable:\ )"

View file

@ -9,7 +9,7 @@ set -l line_endings LF CR CRLF
set -l woff_fmts woff woff2 set -l woff_fmts woff woff2
complete -f -c ttx -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx; __fish_complete_suffix .ttc)' complete -f -c ttx -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx; __fish_complete_suffix .ttc)'
complete -c ttx -f -n __fish_is_first_token -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx)' complete -c ttx -f -n "fish_is_nth_token 1" -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx)'
# General options # General options
complete -c ttx -f -s h -d'Show help message' complete -c ttx -f -s h -d'Show help message'

View file

@ -1,5 +1,5 @@
set -l commands info trigger settle control monitor test test-builtin set -l commands info trigger settle control monitor test test-builtin
complete -c udevadm -n __fish_is_first_token -xa "$commands" complete -c udevadm -n "fish_is_nth_token 1" -xa "$commands"
complete -c udevadm -s h -l help -d "Show help" complete -c udevadm -s h -l help -d "Show help"
complete -c udevadm -s V -l version -d "Show version info" complete -c udevadm -s V -l version -d "Show version info"
@ -59,4 +59,4 @@ complete -c udevadm -n '__fish_seen_subcommand_from test' -s a -l action -d "Set
complete -c udevadm -n '__fish_seen_subcommand_from test' -s N -l resolve-names -d "When to resolve names" -xa "early late never" complete -c udevadm -n '__fish_seen_subcommand_from test' -s N -l resolve-names -d "When to resolve names" -xa "early late never"
# udevadm test-builtin # udevadm test-builtin
complete -c udevadm -n '__fish_seen_subcommand_from test-builtin; and __fish_is_nth_token 2' -xa "blkid\t'Filesystem and partition probing' btrfs\t'btrfs volume management' hwdb\t'Hardware database' input_id\t'Input device properties' keyboard\t'Keybord scan code to key mapping' kmod\t'Kernel module loader' net_id\t'Network device properties' net_setup_link\t'Configure network link' path_id\t'Compose persistent device path' usb_id\t'USB device properties' uaccess\t'Manage device node user ACL'" complete -c udevadm -n '__fish_seen_subcommand_from test-builtin; and fish_is_nth_token 2' -xa "blkid\t'Filesystem and partition probing' btrfs\t'btrfs volume management' hwdb\t'Hardware database' input_id\t'Input device properties' keyboard\t'Keybord scan code to key mapping' kmod\t'Kernel module loader' net_id\t'Network device properties' net_setup_link\t'Configure network link' path_id\t'Compose persistent device path' usb_id\t'USB device properties' uaccess\t'Manage device node user ACL'"

View file

@ -28,7 +28,7 @@ complete -c unzip -s M -d "pipe through `more` pager"
if unzip -v 2>/dev/null | string match -eq Debian if unzip -v 2>/dev/null | string match -eq Debian
# the first non-switch argument should be the zipfile # the first non-switch argument should be the zipfile
complete -c unzip -n __fish_is_first_token -k -xa '( complete -c unzip -n "fish_is_nth_token 1" -k -xa '(
__fish_complete_suffix .zip __fish_complete_suffix .zip
__fish_complete_suffix .jar __fish_complete_suffix .jar
__fish_complete_suffix .aar __fish_complete_suffix .aar
@ -36,7 +36,7 @@ if unzip -v 2>/dev/null | string match -eq Debian
# Files thereafter are either files to include or exclude from the operation # Files thereafter are either files to include or exclude from the operation
set -l zipfile set -l zipfile
complete -c unzip -n 'not __fish_is_first_token' -xa '(unzip -l (eval set zipfile (__fish_first_token); echo $zipfile) | string replace -r --filter ".*:\S+\s+(.*)" "\$1")' complete -c unzip -n 'not fish_is_nth_token 1' -xa '(unzip -l (eval set zipfile (__fish_first_token); echo $zipfile) | string replace -r --filter ".*:\S+\s+(.*)" "\$1")'
else else

View file

@ -18,7 +18,7 @@ complete -c vips -l vips-config -d 'Print libvips config'
complete -c vips -l vips-pipe-read-limit -d 'Pipe read limit (bytes)' complete -c vips -l vips-pipe-read-limit -d 'Pipe read limit (bytes)'
# Operations # Operations
complete -c vips -n __fish_is_first_token -xa "(__fish_vips_ops)" complete -c vips -n "fish_is_nth_token 1" -xa "(__fish_vips_ops)"
function __fish_vips_ops function __fish_vips_ops
vips -l | string match -rv _base | string replace -rf '^\s*\S+ \((.+?)\), +(\S.*?)(?:\s*[,(].*)?$' '$1\t$2' vips -l | string match -rv _base | string replace -rf '^\s*\S+ \((.+?)\), +(\S.*?)(?:\s*[,(].*)?$' '$1\t$2'

View file

@ -15,8 +15,8 @@ complete -c xdg-mime -d 'Query default application for type' -n 'contains_seq qu
complete -c xdg-mime -d 'Query file\'s filetype' -n 'contains_seq query filetype -- (commandline -cop)' -r complete -c xdg-mime -d 'Query file\'s filetype' -n 'contains_seq query filetype -- (commandline -cop)' -r
# complete xdg-mime default # complete xdg-mime default
complete -c xdg-mime -d 'Choose application' -n '__fish_seen_subcommand_from default; and __fish_is_token_n 3' -xa '(__fish_print_xdg_desktop_file_ids)' complete -c xdg-mime -d 'Choose application' -n '__fish_seen_subcommand_from default; and fish_is_nth_token 3' -xa '(__fish_print_xdg_desktop_file_ids)'
complete -c xdg-mime -d Mimetype -n '__fish_seen_subcommand_from default; and __fish_is_token_n 4' -xa '(__fish_print_xdg_mimetypes)' complete -c xdg-mime -d Mimetype -n '__fish_seen_subcommand_from default; and fish_is_nth_token 4' -xa '(__fish_print_xdg_mimetypes)'
# complete xdg-mime install # complete xdg-mime install
complete -c xdg-mime -d 'Add filetype description' -n 'contains_seq xdg-mime install -- (commandline -cop)' -r complete -c xdg-mime -d 'Add filetype description' -n 'contains_seq xdg-mime install -- (commandline -cop)' -r

View file

@ -28,5 +28,5 @@ function __fish_xinput_nth_token
end end
complete -c xinput -f -n "not __fish_seen_subcommand_from $cmds" -a "$cmds" complete -c xinput -f -n "not __fish_seen_subcommand_from $cmds" -a "$cmds"
complete -c xinput -f -n "__fish_is_nth_token 2; and __fish_seen_subcommand_from list get-feedbacks set-pointer set-mode set-ptr-feedback set-integer-feedback set-button-map query-state list-props set-int-prop set-float-prop set-prop watch-props" -a "(__fish_xinput_devices)" complete -c xinput -f -n "fish_is_nth_token 2; and __fish_seen_subcommand_from list get-feedbacks set-pointer set-mode set-ptr-feedback set-integer-feedback set-button-map query-state list-props set-int-prop set-float-prop set-prop watch-props" -a "(__fish_xinput_devices)"
complete -c xinput -f -n "__fish_seen_subcommand_from list set-int-prop set-float-prop set-prop watch-props; and not __fish_is_nth_token 2" -xa "(__fish_xinput_device_props (__fish_xinput_nth_token 2))" complete -c xinput -f -n "__fish_seen_subcommand_from list set-int-prop set-float-prop set-prop watch-props; and not fish_is_nth_token 2" -xa "(__fish_xinput_device_props (__fish_xinput_nth_token 2))"

View file

@ -1,26 +1,26 @@
complete -c xsv -n __fish_is_first_token -xa cat -d 'Concatenate by row or column' complete -c xsv -n "fish_is_nth_token 1" -xa cat -d 'Concatenate by row or column'
complete -c xsv -n __fish_is_first_token -xa count -d 'Count records' complete -c xsv -n "fish_is_nth_token 1" -xa count -d 'Count records'
complete -c xsv -n __fish_is_first_token -xa fixlengths -d 'Makes all records have same length' complete -c xsv -n "fish_is_nth_token 1" -xa fixlengths -d 'Makes all records have same length'
complete -c xsv -n __fish_is_first_token -xa flatten -d 'Show one field per line' complete -c xsv -n "fish_is_nth_token 1" -xa flatten -d 'Show one field per line'
complete -c xsv -n __fish_is_first_token -xa fmt -d 'Format CSV output (change field delimiter)' complete -c xsv -n "fish_is_nth_token 1" -xa fmt -d 'Format CSV output (change field delimiter)'
complete -c xsv -n __fish_is_first_token -xa frequency -d 'Show frequency tables' complete -c xsv -n "fish_is_nth_token 1" -xa frequency -d 'Show frequency tables'
complete -c xsv -n __fish_is_first_token -xa headers -d 'Show header names' complete -c xsv -n "fish_is_nth_token 1" -xa headers -d 'Show header names'
complete -c xsv -n __fish_is_first_token -xa help -d 'Show this usage message.' complete -c xsv -n "fish_is_nth_token 1" -xa help -d 'Show this usage message.'
complete -c xsv -n __fish_is_first_token -xa index -d 'Create CSV index for faster access' complete -c xsv -n "fish_is_nth_token 1" -xa index -d 'Create CSV index for faster access'
complete -c xsv -n __fish_is_first_token -xa input -d 'Read CSV data with special quoting rules' complete -c xsv -n "fish_is_nth_token 1" -xa input -d 'Read CSV data with special quoting rules'
complete -c xsv -n __fish_is_first_token -xa join -d 'Join CSV files' complete -c xsv -n "fish_is_nth_token 1" -xa join -d 'Join CSV files'
complete -c xsv -n __fish_is_first_token -xa sample -d 'Randomly sample CSV data' complete -c xsv -n "fish_is_nth_token 1" -xa sample -d 'Randomly sample CSV data'
complete -c xsv -n __fish_is_first_token -xa search -d 'Search CSV data with regexes' complete -c xsv -n "fish_is_nth_token 1" -xa search -d 'Search CSV data with regexes'
complete -c xsv -n __fish_is_first_token -xa select -d 'Select columns from CSV' complete -c xsv -n "fish_is_nth_token 1" -xa select -d 'Select columns from CSV'
complete -c xsv -n __fish_is_first_token -xa slice -d 'Slice records from CSV' complete -c xsv -n "fish_is_nth_token 1" -xa slice -d 'Slice records from CSV'
complete -c xsv -n __fish_is_first_token -xa sort -d 'Sort CSV data' complete -c xsv -n "fish_is_nth_token 1" -xa sort -d 'Sort CSV data'
complete -c xsv -n __fish_is_first_token -xa split -d 'Split CSV data into many files' complete -c xsv -n "fish_is_nth_token 1" -xa split -d 'Split CSV data into many files'
complete -c xsv -n __fish_is_first_token -xa stats -d 'Compute basic statistics' complete -c xsv -n "fish_is_nth_token 1" -xa stats -d 'Compute basic statistics'
complete -c xsv -n __fish_is_first_token -xa table -d 'Align CSV data into columns' complete -c xsv -n "fish_is_nth_token 1" -xa table -d 'Align CSV data into columns'
# with a subcommand # with a subcommand
complete -c xsv -n 'not __fish_is_first_token' -k -xa '(__fish_complete_suffix .csv)' complete -c xsv -n 'not fish_is_nth_token 1' -k -xa '(__fish_complete_suffix .csv)'
complete -c xsv -n 'not __fish_is_first_token' -s h -l help -d 'Display help for this xsv command' complete -c xsv -n 'not fish_is_nth_token 1' -s h -l help -d 'Display help for this xsv command'
# without a subcommand # without a subcommand
complete -c xsv -s h -l help -d 'Display xsv help' complete -c xsv -s h -l help -d 'Display xsv help'

View file

@ -128,4 +128,4 @@ complete -f -c yadm -n "__fish_yadm_using_command config" -l unset -a '(__fish_y
complete -f -c yadm -n "__fish_yadm_using_command config" -l unset-all -a '(__fish_yadm_config_keys)' -d 'Remove matching variables' complete -f -c yadm -n "__fish_yadm_using_command config" -l unset-all -a '(__fish_yadm_config_keys)' -d 'Remove matching variables'
# If no argument is specified for `config`, it's as if --get was used # If no argument is specified for `config`, it's as if --get was used
complete -f -c yadm -n "__fish_yadm_using_command config; and __fish_is_token_n 3" -a '(__fish_yadm_config_keys)' complete -f -c yadm -n "__fish_yadm_using_command config; and fish_is_nth_token 3" -a '(__fish_yadm_config_keys)'

View file

@ -1,15 +1,4 @@
function __fish_is_first_token -d 'Test if no non-switch argument has been specified yet' function __fish_is_first_token -d 'Test if no non-switch argument has been specified yet'
set -l cmd (commandline -poc) fish_is_nth_token 1
set -e cmd[1]
for i in $cmd
switch $i
case '-*'
case '*'
return 1
end
end
return 0
end end

View file

@ -1,6 +1,3 @@
function __fish_is_nth_token function __fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n
set -l n $argv[1] fish_is_nth_token $n
set -l tokens (commandline -poc)
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
test (count $tokens) -eq "$n"
end end

View file

@ -1,5 +1,5 @@
function __fish_is_token_n --description 'Test if current token is on Nth place' --argument-names n function __fish_is_token_n --description 'Test if current token is on Nth place' --argument-names n
# Add a fake element to increment without calling math fish_is_nth_token $n
set -l num (count (commandline -poc) additionalelement)
test $n -eq $num
end end

View file

@ -0,0 +1,5 @@
function fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n
set -l tokens (commandline -poc)
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
test (count $tokens) -eq "$n"
end