mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-14 04:23:31 +08:00
Reformat share/{completions,functions}
This commit is contained in:
parent
f139d8ebed
commit
c12f853db2
|
@ -1,4 +1,3 @@
|
|||
|
||||
complete -c bru -s h -l help -d "Show help"
|
||||
complete -c bru -l version -d "Show version number"
|
||||
|
||||
|
|
|
@ -4,59 +4,59 @@ function __fish_btrbk_complete_filter
|
|||
end
|
||||
|
||||
# options with arguments
|
||||
complete -c btrbk -l format -x -d 'Change output format' -a "table long raw"
|
||||
complete -c btrbk -l loglevel -s l -x -d 'Set logging level' -a "error warn info debug trace"
|
||||
complete -c btrbk -l exclude -x -d 'Exclude configured sections' -a "(__fish_btrbk_complete_filter)"
|
||||
complete -c btrbk -l override -x -d 'Globally override a configuration option'
|
||||
complete -c btrbk -l format -x -d 'Change output format' -a "table long raw"
|
||||
complete -c btrbk -l loglevel -s l -x -d 'Set logging level' -a "error warn info debug trace"
|
||||
complete -c btrbk -l exclude -x -d 'Exclude configured sections' -a "(__fish_btrbk_complete_filter)"
|
||||
complete -c btrbk -l override -x -d 'Globally override a configuration option'
|
||||
|
||||
# options with file completion
|
||||
complete -c btrbk -l config -r -s c -d 'Specify configuration file'
|
||||
complete -c btrbk -l lockfile -r -d 'Create and check lockfile'
|
||||
complete -c btrbk -l config -r -s c -d 'Specify configuration file'
|
||||
complete -c btrbk -l lockfile -r -d 'Create and check lockfile'
|
||||
|
||||
# options without arguments
|
||||
complete -c btrbk -l help -s h -d 'Display this help message'
|
||||
complete -c btrbk -l version -d 'Display version information'
|
||||
complete -c btrbk -l dry-run -s n -d 'Perform a trial run with no changes made'
|
||||
complete -c btrbk -l preserve -s p -d 'Preserve all (do not delete anything)'
|
||||
complete -c btrbk -l preserve-snapshots -d 'Preserve snapshots (do not delete snapshots)'
|
||||
complete -c btrbk -l preserve-backups -d 'Preserve backups (do not delete backups)'
|
||||
complete -c btrbk -l wipe -d 'Delete all but latest snapshots'
|
||||
complete -c btrbk -l verbose -s v -d 'Be more verbose (increase logging level)'
|
||||
complete -c btrbk -l quiet -s q -d 'Be quiet (do not print backup summary)'
|
||||
complete -c btrbk -l table -s t -d 'Change output to table format'
|
||||
complete -c btrbk -l long -s L -d 'Change output to long format'
|
||||
complete -c btrbk -l print-schedule -s S -d 'Print scheduler details (for the "run" command)'
|
||||
complete -c btrbk -l progress -d 'Show progress bar on send-receive operation'
|
||||
complete -c btrbk -l help -s h -d 'Display this help message'
|
||||
complete -c btrbk -l version -d 'Display version information'
|
||||
complete -c btrbk -l dry-run -s n -d 'Perform a trial run with no changes made'
|
||||
complete -c btrbk -l preserve -s p -d 'Preserve all (do not delete anything)'
|
||||
complete -c btrbk -l preserve-snapshots -d 'Preserve snapshots (do not delete snapshots)'
|
||||
complete -c btrbk -l preserve-backups -d 'Preserve backups (do not delete backups)'
|
||||
complete -c btrbk -l wipe -d 'Delete all but latest snapshots'
|
||||
complete -c btrbk -l verbose -s v -d 'Be more verbose (increase logging level)'
|
||||
complete -c btrbk -l quiet -s q -d 'Be quiet (do not print backup summary)'
|
||||
complete -c btrbk -l table -s t -d 'Change output to table format'
|
||||
complete -c btrbk -l long -s L -d 'Change output to long format'
|
||||
complete -c btrbk -l print-schedule -s S -d 'Print scheduler details (for the "run" command)'
|
||||
complete -c btrbk -l progress -d 'Show progress bar on send-receive operation'
|
||||
|
||||
# uncommon options from manpage
|
||||
complete -c btrbk -l single-column -s 1 -d 'Print output as a single column'
|
||||
complete -c btrbk -l pretty -d 'Print pretty table output with lowercase and underlined column headings'
|
||||
complete -c btrbk -l raw -d 'Create raw targets for archive command'
|
||||
complete -c btrbk -l pretty -d 'Print pretty table output with lowercase and underlined column headings'
|
||||
complete -c btrbk -l raw -d 'Create raw targets for archive command'
|
||||
|
||||
# subcommands
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a run -d 'Run snapshot and backup operations'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a dryrun -d 'Show what would be executed without running btrfs commands'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a run -d 'Run snapshot and backup operations'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a dryrun -d 'Show what would be executed without running btrfs commands'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a snapshot -d 'Run snapshot operations only'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a resume -d 'Run backup operations and delete snapshots'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a prune -d 'Only delete snapshots and backups'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a archive -d 'Recursively copy all subvolumes (src -> dst)'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a clean -d 'Delete incomplete (garbled) backups'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a stats -d 'Print snapshot/backup statistics'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a usage -d 'Print filesystem usage'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a ls -d 'List all btrfs subvolumes below a given path'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a origin -d 'Print origin information for a subvolume'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a diff -d 'List file changes between related subvolumes'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a extents -d 'Calculate accurate disk space usage for a path'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a list -d 'List snapshots and backups'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a resume -d 'Run backup operations and delete snapshots'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a prune -d 'Only delete snapshots and backups'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a archive -d 'Recursively copy all subvolumes (src -> dst)'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a clean -d 'Delete incomplete (garbled) backups'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a stats -d 'Print snapshot/backup statistics'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a usage -d 'Print filesystem usage'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a ls -d 'List all btrfs subvolumes below a given path'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a origin -d 'Print origin information for a subvolume'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a diff -d 'List file changes between related subvolumes'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a extents -d 'Calculate accurate disk space usage for a path'
|
||||
complete -c btrbk -f -n __fish_use_subcommand -a list -d 'List snapshots and backups'
|
||||
|
||||
# subsubcommands for "list"
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a all -d 'List all snapshots and backups'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a all -d 'List all snapshots and backups'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a snapshots -d 'List snapshots only'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a backups -d 'List backups and correlated snapshots'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a latest -d 'List most recent snapshots and backups'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a config -d 'List configured source/snapshot/target relations'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a source -d 'List configured source/snapshot relations'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a volume -d 'List configured volume sections'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a target -d 'List configured targets'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a backups -d 'List backups and correlated snapshots'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a latest -d 'List most recent snapshots and backups'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a config -d 'List configured source/snapshot/target relations'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a source -d 'List configured source/snapshot relations'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a volume -d 'List configured volume sections'
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from list' -f -a target -d 'List configured targets'
|
||||
|
||||
complete -c btrbk -n '__fish_seen_subcommand_from run dryrun snapshot resume prune clean' -x -a '(__fish_btrbk_complete_filter)'
|
||||
|
|
|
@ -29,40 +29,40 @@ complete -c $command -s L -l load-path -F \
|
|||
|
||||
complete -c $command -s o -l output -F \
|
||||
-d 'Specify the output file to put bytecode in' \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
|
||||
complete -c $command -s x -x \
|
||||
-d 'Specify the extension to prepend to extension list' \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
|
||||
complete -c $command -s W -l warning \
|
||||
-a '(__fish_complete_list , __fish_guild__complete_warnings)' \
|
||||
-d 'Specify the warning level for a compilation' \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
|
||||
complete -c $command -s O -l optimize \
|
||||
-a '(__fish_guild__complete_optimizations)' \
|
||||
-d 'Specify the optimization level for a compilation' \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
|
||||
for standard in 6 7
|
||||
set -l option r$standard"rc"
|
||||
|
||||
complete -c $command -l $option \
|
||||
-d "Use $(string upper -- $option) compatible mode" \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
end
|
||||
|
||||
complete -c $command -s f -l from \
|
||||
-a 'scheme\tdefault elisp ecmascript' \
|
||||
-d 'Specify the language for sources' \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
|
||||
complete -c $command -s t -l to \
|
||||
-a 'rtl\tdefault' \
|
||||
-d 'Specify the language for an output' \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
|
||||
complete -c $command -s T -l target \
|
||||
-d 'Specify the target for a code' \
|
||||
-n $compile_condition
|
||||
-n $compile_condition
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function __fish_iftop_sort_orders
|
||||
echo -e "2s\tSort by 2s traffic average"
|
||||
echo -e "10s\tSort by 10s traffic average (default)"
|
||||
echo -e "40s\tSort by 40s traffic average"
|
||||
echo -e "source\tSort by source address"
|
||||
echo -e "destination\tSort by destination address"
|
||||
echo -e "2s\tSort by 2s traffic average"
|
||||
echo -e "10s\tSort by 10s traffic average (default)"
|
||||
echo -e "40s\tSort by 40s traffic average"
|
||||
echo -e "source\tSort by source address"
|
||||
echo -e "destination\tSort by destination address"
|
||||
end
|
||||
|
||||
complete -c iftop -f
|
||||
|
|
|
@ -7,7 +7,7 @@ complete -c lazygit -s p -l path -d 'Path of git repo' -xa "(__fish_complete_dir
|
|||
complete -c lazygit -s c -l config -d 'Print the default config'
|
||||
complete -c lazygit -o cd -l print-config-dir -d 'Print the config directory'
|
||||
complete -c lazygit -o ucd -l use-config-dir -d 'Override default config directory with provided directory' -r
|
||||
complete -c lazygit -o ucf -l use-config-file -d 'Comma separated list to custom config file(s)' -r
|
||||
complete -c lazygit -o ucf -l use-config-file -d 'Comma separated list to custom config file(s)' -r
|
||||
|
||||
# Git
|
||||
complete -c lazygit -s f -l filter -d 'Path to filter on in `git log -- <path>`' -r
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
|
||||
set -l subcmds prompt aliases chat collections embed embed-models embed-multi install keys logs models openai plugins similar templates uninstall
|
||||
function __fish_llm_subcmds
|
||||
printf "%s\t%s\n" "prompt" "Execute a prompt" \
|
||||
"aliases" "Manage model aliases" \
|
||||
"chat" "Hold chat with model" \
|
||||
"collections" "View/manage embedding collections" \
|
||||
"embed" "Embed text and get/store result" \
|
||||
"embed-models" "Manage available embedding models" \
|
||||
"embed-multi" "Store embeddings for multiple strings" \
|
||||
"install" "Install PyPI packages into llm env" \
|
||||
"keys" "Manage stored API keys" \
|
||||
"logs" "Explore logged prompts/responses" \
|
||||
"models" "Manage available models" \
|
||||
"openai" "Work with OpenAI API directly" \
|
||||
"plugins" "List installed plugins" \
|
||||
"similar" "Return top-N similar IDs for collection" \
|
||||
"templates" "Manage stored prompt templates" \
|
||||
"uninstall" "Uninstall Python packages from llm env"
|
||||
printf "%s\t%s\n" prompt "Execute a prompt" \
|
||||
aliases "Manage model aliases" \
|
||||
chat "Hold chat with model" \
|
||||
collections "View/manage embedding collections" \
|
||||
embed "Embed text and get/store result" \
|
||||
embed-models "Manage available embedding models" \
|
||||
embed-multi "Store embeddings for multiple strings" \
|
||||
install "Install PyPI packages into llm env" \
|
||||
keys "Manage stored API keys" \
|
||||
logs "Explore logged prompts/responses" \
|
||||
models "Manage available models" \
|
||||
openai "Work with OpenAI API directly" \
|
||||
plugins "List installed plugins" \
|
||||
similar "Return top-N similar IDs for collection" \
|
||||
templates "Manage stored prompt templates" \
|
||||
uninstall "Uninstall Python packages from llm env"
|
||||
end
|
||||
|
||||
complete -c llm -n __fish_is_first_token -xa "(__fish_llm_subcmds)"
|
||||
|
@ -29,23 +29,23 @@ complete -c llm -l help -d "Show command usage info" -x
|
|||
|
||||
function __fish_llm_models
|
||||
llm models |
|
||||
string replace -r '^[^:\\n]+: (\\S+)(?: \\(aliases: )?((?:[^),\\s]+,?)?+.*?)\\)?$' '$1 $2' |
|
||||
string split ' ' -n |
|
||||
string trim -c ','
|
||||
string replace -r '^[^:\\n]+: (\\S+)(?: \\(aliases: )?((?:[^),\\s]+,?)?+.*?)\\)?$' '$1 $2' |
|
||||
string split ' ' -n |
|
||||
string trim -c ','
|
||||
end
|
||||
|
||||
function __fish_embedding_models
|
||||
llm models |
|
||||
string replace -r '^[^:\\n]+: (\\S+)(?: \\(aliases: )?((?:[^),\\s]+,?)?+.*?)\\)?$' '$1 $2' |
|
||||
string split ' ' -n |
|
||||
string trim -c ','
|
||||
string replace -r '^[^:\\n]+: (\\S+)(?: \\(aliases: )?((?:[^),\\s]+,?)?+.*?)\\)?$' '$1 $2' |
|
||||
string split ' ' -n |
|
||||
string trim -c ','
|
||||
end
|
||||
|
||||
# The default subcommand is 'prompt'
|
||||
set -l condition "not __fish_seen_subcommand_from $subcmds || __fish_seen_subcommand_from prompt"
|
||||
complete -c llm -n $condition -s s -l system -d "System prompt to use" -r
|
||||
complete -c llm -n $condition -s m -l model -d "Model to use" -xa "(__fish_llm_models)"
|
||||
complete -c llm -n $condition -s a -l attachment -d "Attachment to use" -ra'-'
|
||||
complete -c llm -n $condition -s a -l attachment -d "Attachment to use" -ra-
|
||||
complete -c llm -n $condition -l at -d "Attachment type" -r
|
||||
complete -c llm -n $condition -l attachment-type -d "Attachment type" -r
|
||||
complete -c llm -n $condition -s n -l no-log -d "Don't log to db" -x
|
||||
|
|
|
@ -5,4 +5,4 @@ complete -c lsb_release -s r -l release -d 'Show release number'
|
|||
complete -c lsb_release -s c -l codename -d 'Show code name'
|
||||
complete -c lsb_release -s h -l help -d 'Show help message'
|
||||
complete -c lsb_release -s v -l version -d 'Show LSB modules supported'
|
||||
complete -c lsb_release -s s -l short -d 'Show in short format'
|
||||
complete -c lsb_release -s s -l short -d 'Show in short format'
|
||||
|
|
|
@ -2,7 +2,6 @@ function __fish_ollama_list
|
|||
ollama list 2>/dev/null | tail -n +2 | string replace --regex "\s.*" ""
|
||||
end
|
||||
|
||||
|
||||
complete -f -c ollama
|
||||
complete -c ollama -n __fish_use_subcommand -a serve -d "Start ollama"
|
||||
complete -c ollama -n __fish_use_subcommand -a create -d "Create a model from a Modelfile"
|
||||
|
|
|
@ -2,13 +2,12 @@ if set -l rclone_version (rclone version | string match -rg 'rclone v?(.*)' | st
|
|||
test "$rclone_version[1]" -lt 1 ||
|
||||
test "$rclone_version[1]" -eq 1 &&
|
||||
test "$rclone_version[2]" -le 62
|
||||
# version is definitely <= 1.62, adding a `-` would be an error
|
||||
rclone completion fish
|
||||
# version is definitely <= 1.62, adding a `-` would be an error
|
||||
rclone completion fish
|
||||
else
|
||||
# For newer versions, this requires an `-`. Without a `-`, it would
|
||||
# try to write to /etc/completions/fish.
|
||||
# If we can't determine the version, assume a recent one. An error
|
||||
# is better than trying to write to /etc unexpectedly.
|
||||
rclone completion fish -
|
||||
# For newer versions, this requires an `-`. Without a `-`, it would
|
||||
# try to write to /etc/completions/fish.
|
||||
# If we can't determine the version, assume a recent one. An error
|
||||
# is better than trying to write to /etc unexpectedly.
|
||||
rclone completion fish -
|
||||
end 2>/dev/null | source
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ complete -c tmux -n "__fish_seen_subcommand_from $breakp $linkw $movew $neww $sw
|
|||
complete -c tmux -n "__fish_seen_subcommand_from $killw $lastp $nextl $prevl $renamew" -xs t -d 'target window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $resizew $reswpawnw $rotatew $selectw $unlinkw" -xs t -d 'target window'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $displayp" -xs t -d 'target client'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lsp" -xs t -d 'target'
|
||||
complete -c tmux -n "__fish_seen_subcommand_from $lsp" -xs t -d target
|
||||
|
||||
############### End: Windows and Panes ###############
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user