This mostly fixes some wrong indents or replaces some stray tab indents.

I excluded alignment on purpose, because we have a whole bunch of code
that goes like

```fish
complete -c foo -n 'some-condition'        -l someoption
complete -c foo -n 'some-longer-condition' -l someotheroption
```

and changing it seems like a larger thing and would include more
thrashing.

See #3622.
This commit is contained in:
Fabian Homborg 2019-11-16 14:57:59 +01:00
parent aae111584d
commit 330f1701d7
13 changed files with 321 additions and 316 deletions

View File

@ -5,7 +5,7 @@ end
function __fish_ansible_vault_using_command
set -l cmd (string trim (__fish_ansible_vault_no_subcommand))
test -z "$cmd";
test -z "$cmd"
and return 1
contains -- "$cmd" $argv
end

View File

@ -1,7 +1,7 @@
# Visual Studio Code
function __fish_complete_vscode_extensions
command --quiet code; and code --list-extensions
command --quiet code; and code --list-extensions
end
complete -c code -s d -l diff -d 'Compare two files with each other'

View File

@ -51,7 +51,7 @@ set -l sharpness_opts '
'
function __fish_cwebp_pass_opts
seq 0 10 | awk '{printf "%s\t\n", $0}' -
seq 0 10 | awk '{printf "%s\t\n", $0}' -
end
set -l alpha_method_opts '

View File

@ -22,8 +22,8 @@ end
# Print an optspec for argparse to handle git's options that are independent of any subcommand.
function __fish_git_global_optspecs
string join \n v-version h/help C= c=+ 'e-exec-path=?' H-html-path M-man-path I-info-path p/paginate \
P/no-pager o-no-replace-objects b-bare G-git-dir= W-work-tree= N-namespace= S-super-prefix= \
l-literal-pathspecs g-glob-pathspecs O-noglob-pathspecs i-icase-pathspecs
P/no-pager o-no-replace-objects b-bare G-git-dir= W-work-tree= N-namespace= S-super-prefix= \
l-literal-pathspecs g-glob-pathspecs O-noglob-pathspecs i-icase-pathspecs
end
function __fish_git_commits
@ -1425,7 +1425,7 @@ complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_
complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q ":*" -- (commandline -ct)' -a ':(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Delete remote branch'
# then src:dest (where both src and dest are git objects, so we want to complete branches)
complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q "+*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Force-push local branch to remote branch'
complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q "*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Push local branch to remote branch'
complete -f -c git -n '__fish_git_using_command push; and __fish_git_branch_for_remote; and string match -q "*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Push local branch to remote branch'
complete -f -c git -n '__fish_git_using_command push' -l all -d 'Push all refs under refs/heads/'
complete -f -c git -n '__fish_git_using_command push' -l prune -d "Remove remote branches that don't have a local counterpart"
complete -f -c git -n '__fish_git_using_command push' -l mirror -d 'Push all refs under refs/'

View File

@ -43,7 +43,7 @@ function __fish_complete_iw
case ap
if not set -q cmd[5]
printf '%s\t%s\n' stop "Stop AP functionality" \
start "Start AP functionality"
start "Start AP functionality"
end
case auth connect
if not set -q cmd[5]
@ -60,12 +60,12 @@ function __fish_complete_iw
case ftm
if not set -q cmd[5]
printf '%s\t%s\n' start_responder "Start an FTM responder" \
get_stats "Get FTM responder statistics"
get_stats "Get FTM responder statistics"
end
case ibss
if not set -q cmd[5]
printf '%s\t%s\n' join "Join an IBSS cell or create one" \
leave "Leave the current IBSS cell"
leave "Leave the current IBSS cell"
end
case 'switch'
if not set -q cmd[5]
@ -88,7 +88,7 @@ function __fish_complete_iw
case mesh
if not set -q cmd[5]
printf '%s\t%s\n' leave "Leave a mesh" \
join "Join a mesh"
join "Join a mesh"
end
case mgmt
if not set -q cmd[5]
@ -99,21 +99,21 @@ function __fish_complete_iw
case mpath
if not set -q cmd[5]
printf '%s\t%s\n' dump "List known mesh paths" \
set "Set an existing mesh path's next hop" \
new "Create a new mesh math manually" \
del "Remove the mesh path to a node" \
get "Get information on a mesh path to a node" \
probe "Inject ethernet frame to a peer"
set "Set an existing mesh path's next hop" \
new "Create a new mesh math manually" \
del "Remove the mesh path to a node" \
get "Get information on a mesh path to a node" \
probe "Inject ethernet frame to a peer"
end
case mpp
if not set -q cmd[5]
printf '%s\t%s\n' dump "List known mesh proxy paths" \
get "Get information on mesh proxy path to a node"
get "Get information on mesh proxy path to a node"
end
case ocb
if not set -q cmd[5]
printf '%s\t%s\n' leave "Leave the OCB mode network" \
join "Join the OCB mode network"
join "Join the OCB mode network"
end
case cac
if not set -q cmd[5]
@ -128,39 +128,39 @@ function __fish_complete_iw
case scan
if not set -q cmd[5]
printf '%s\t%s\n' sched_stop "Stop an ongoing scheduled scan" \
sched_start "Start a scheduled scan" \
abort "Abort ongoing scan" \
trigger "Trigger a scan" \
dump "Dmp the current scan results"
sched_start "Start a scheduled scan" \
abort "Abort ongoing scan" \
trigger "Trigger a scan" \
dump "Dmp the current scan results"
end
# -u option?
case set
if not set -q cmd[5]
printf '%s\t%s\n' bitrates "Rate masks" \
mcast_rate "Multicast bitrate" \
peer "WDS peer" \
noack_map "Noack map for TIDs" \
4addr "4addr (WDS) mode" \
type "Interface type/mode" \
meshid "" \
monitor "Monitor flags" \
mesh_param "Mesh parameter" \
txpower "Transmit power" \
channel "" \
freq "" \
power_save "Power save state"
mcast_rate "Multicast bitrate" \
peer "WDS peer" \
noack_map "Noack map for TIDs" \
4addr "4addr (WDS) mode" \
type "Interface type/mode" \
meshid "" \
monitor "Monitor flags" \
mesh_param "Mesh parameter" \
txpower "Transmit power" \
channel "" \
freq "" \
power_save "Power save state"
end
case get
if not set -q cmd[5]
printf '%s\t%s\n' mesh_param "Mesh parameter" \
power_save "Power save state"
power_save "Power save state"
end
case station
if not set -q cmd[5]
printf '%s\t%s\n' dump "List all stations known" \
set "Set station options" \
del "Remove a station entry" \
get "Get information for a station"
set "Set station options" \
del "Remove a station entry" \
get "Get information for a station"
end
case survey
if not set -q cmd[5]
@ -174,40 +174,40 @@ function __fish_complete_iw
end
case '*'
printf '%s\t%s\n' ap "Start/stop AP functionality" \
auth "Authenticate with a network" \
connect "Join a network" \
disconnect "Disconnect from the current network" \
cqm "Set connection quality monitor RSSI threshold" \
ftm "Control the FTM responder" \
ibss "Join or leave a IBSS cell" \
'switch' "Switch the operating channel by sending a CSA" \
info "Show information for this interface" \
del "Remove this virtual interface" \
interface "Control the interface" \
link "Print information about the current link" \
measurement "Perform measurements" \
mesh "Join or leave a mesh" \
mpp "Get information on mesh proxy paths" \
mgmt "Print mgmt frames" \
mpath "Interact with mesh paths" \
ocb "Join or leave an OCB mode network" \
offchannel "Leave operating channel" \
cac "Start or trigger a channel availability chec" \
roc "" \
scan "Scan and probe for SSIDs" \
set "Set parameters" \
get "Get parameters" \
station "Set station parameters" \
survey "List all gathered channel survey data" \
vendor ""
auth "Authenticate with a network" \
connect "Join a network" \
disconnect "Disconnect from the current network" \
cqm "Set connection quality monitor RSSI threshold" \
ftm "Control the FTM responder" \
ibss "Join or leave a IBSS cell" \
'switch' "Switch the operating channel by sending a CSA" \
info "Show information for this interface" \
del "Remove this virtual interface" \
interface "Control the interface" \
link "Print information about the current link" \
measurement "Perform measurements" \
mesh "Join or leave a mesh" \
mpp "Get information on mesh proxy paths" \
mgmt "Print mgmt frames" \
mpath "Interact with mesh paths" \
ocb "Join or leave an OCB mode network" \
offchannel "Leave operating channel" \
cac "Start or trigger a channel availability chec" \
roc "" \
scan "Scan and probe for SSIDs" \
set "Set parameters" \
get "Get parameters" \
station "Set station parameters" \
survey "List all gathered channel survey data" \
vendor ""
end
case phy
switch "$cmd[4]"
case coalesce
if not set -q cmd[5]
printf '%s\t%s\n' show "Show coalesce status" \
disable "Disable coalesce" \
enable "Enable coalesce"
disable "Disable coalesce" \
enable "Enable coalesce"
else if [ "$cmd[5]" = "enable" ] && not set -q cmd[6]
__fish_complete_path # Enable takes a config file
end
@ -224,20 +224,20 @@ function __fish_complete_iw
case reg
if not set -q cmd[5]
printf '%s\t%s\n' get "Print the current regulatory domain information" \
set "Notify kernel about current regulatory domain"
set "Notify kernel about current regulatory domain"
end
case set
if not set -q cmd[5]
printf '%s\t%s\n' txq "TXQ parameters" \
antenna "Bitmap of allowed antennas" \
txpower "Transmit power" \
distance "Link distance coverage class" \
netns "Network namespace" \
retry "Retry limit" \
rts "Rts threshold" \
frag "Fragmentation threshold" \
channel "" \
name "Wireless device name"
antenna "Bitmap of allowed antennas" \
txpower "Transmit power" \
distance "Link distance coverage class" \
netns "Network namespace" \
retry "Retry limit" \
rts "Rts threshold" \
frag "Fragmentation threshold" \
channel "" \
name "Wireless device name"
end
case get
if not set -q cmd[5]
@ -246,18 +246,18 @@ function __fish_complete_iw
case get
if not set -q cmd[5]
printf '%s\t%s\n' show "Show WoWLAN status" \
disable "Disable WoWLAN" \
enable "Enable WoWLAN"
disable "Disable WoWLAN" \
enable "Enable WoWLAN"
end
case '*'
printf '%s\t%s\n' coalesce "Interface with coalesce" \
hwsim "" \
info "Show wireless device capabilities" \
interface "Add a new virutal interface" \
channels "Show available channels" \
reg "Manage regulatory domains" \
set "Set parameters" \
get "Get parameters"
hwsim "" \
info "Show wireless device capabilities" \
interface "Add a new virutal interface" \
channels "Show available channels" \
reg "Manage regulatory domains" \
set "Set parameters" \
get "Get parameters"
end
end
end

View File

@ -1,12 +1,12 @@
function __fish_complete_nethack
set -l roles Archeologist Barbarian Cave{man,woman} Healer Knight Monk \
Priest{,ess} Rogue Ranger Samurai Tourist Valkyrie Wizard
set -l roles Archeologist Barbarian Cave{man,woman} Healer Knight Monk \
Priest{,ess} Rogue Ranger Samurai Tourist Valkyrie Wizard
set -l races Human Elf Dwarf Gnome Orc
set -l races Human Elf Dwarf Gnome Orc
for r in $$argv[1]
printf "%s\t%s\n" (string sub -l 3 $r) $r
end
for r in $$argv[1]
printf "%s\t%s\n" (string sub -l 3 $r) $r
end
end
complete -c nethack -s d -ra "(__fish_complete_directories)" -d 'Specify a playground directory'

View File

@ -1,21 +1,21 @@
complete -c rustup -e
set -l subcmds \
"show" \
"update" \
"default" \
"toolchain" \
"target" \
"component" \
"override" \
"run" \
"which" \
"doc" \
"man" \
"self" \
"set" \
# "completions" \
"help"
"show" \
"update" \
"default" \
"toolchain" \
"target" \
"component" \
"override" \
"run" \
"which" \
"doc" \
"man" \
"self" \
"set" \
# "completions" \
"help"
set -l rustup_show \
"active-toolchain" \
@ -24,8 +24,8 @@ set -l rustup_show \
"help"
# rustup does not really expose a mechanism of retrieving a list of all valid components without the archs appended
function __rustup_components
rustup component list | string match -r "^\S+" | string replace -f -- "-x86_64-unknown-linux-gnu" ""
function __rustup_components
rustup component list | string match -r "^\S+" | string replace -f -- "-x86_64-unknown-linux-gnu" ""
end
# function __rustup_installable_components
@ -35,186 +35,186 @@ end
# All *valid* target triples, retrieved from source
function __rustup_triples
# The list below must be kept sorted alphabetically
printf "%s\n" \
"aarch64-apple-ios" \
"aarch64-linux-android" \
"aarch64-pc-windows-msvc" \
"aarch64-unknown-cloudabi" \
"aarch64-unknown-fuchsia" \
"aarch64-unknown-linux-gnu" \
"aarch64-unknown-linux-musl" \
"aarch64-unknown-redox" \
"armebv7r-none-eabi" \
"armebv7r-none-eabihf" \
"arm-linux-androideabi" \
"arm-unknown-linux-gnueabi" \
"arm-unknown-linux-gnueabihf" \
"arm-unknown-linux-musleabi" \
"arm-unknown-linux-musleabihf" \
"armv5te-unknown-linux-gnueabi" \
"armv5te-unknown-linux-musleabi" \
"armv7-apple-ios" \
"armv7-linux-androideabi" \
"armv7r-none-eabi" \
"armv7r-none-eabihf" \
"armv7s-apple-ios" \
"armv7-unknown-cloudabi-eabihf" \
"armv7-unknown-linux-gnueabi" \
"armv7-unknown-linux-gnueabihf" \
"armv7-unknown-linux-musleabi" \
"armv7-unknown-linux-musleabihf" \
"asmjs-unknown-emscripten" \
"i386-apple-ios" \
"i586-pc-windows-msvc" \
"i586-unknown-linux-gnu" \
"i586-unknown-linux-musl" \
"i686-apple-darwin" \
"i686-linux-android" \
"i686-pc-windows-gnu" \
"i686-pc-windows-msvc" \
"i686-unknown-cloudabi" \
"i686-unknown-freebsd" \
"i686-unknown-haiku" \
"i686-unknown-linux-gnu" \
"i686-unknown-linux-musl" \
"i686-unknown-netbsd" \
"le32-unknown-nacl" \
"mips64el-unknown-linux-gnuabi64" \
"mips64-unknown-linux-gnuabi64" \
"mipsel-unknown-linux-gnu" \
"mipsel-unknown-linux-musl" \
"mipsel-unknown-linux-uclibc" \
"mipsisa32r6el-unknown-linux-gnu" \
"mipsisa32r6-unknown-linux-gnu" \
"mipsisa64r6el-unknown-linux-gnuabi64" \
"mipsisa64r6-unknown-linux-gnuabi64" \
"mips-unknown-linux-gnu" \
"mips-unknown-linux-musl" \
"mips-unknown-linux-uclibc" \
"msp430-none-elf" \
"nvptx64-nvidia-cuda" \
"powerpc64le-unknown-linux-gnu" \
"powerpc64-unknown-linux-gnu" \
"powerpc-unknown-linux-gnu" \
"powerpc-unknown-linux-gnuspe" \
"riscv32imac-unknown-none-elf" \
"riscv32imc-unknown-none-elf" \
"riscv32i-unknown-none-elf" \
"riscv64gc-unknown-none-elf" \
"riscv64imac-unknown-none-elf" \
"s390x-unknown-linux-gnu" \
"sparc64-unknown-linux-gnu" \
"sparc64-unknown-netbsd" \
"sparc-unknown-linux-gnu" \
"sparcv9-sun-solaris" \
"thumbv6m-none-eabi" \
"thumbv7em-none-eabi" \
"thumbv7em-none-eabihf" \
"thumbv7m-none-eabi" \
"thumbv7neon-linux-androideabi" \
"thumbv7neon-unknown-linux-gnueabihf" \
"thumbv8m.base-none-eabi" \
"thumbv8m.main-none-eabi" \
"thumbv8m.main-none-eabihf" \
"wasm32-unknown-emscripten" \
"wasm32-unknown-unknown" \
"x86_64-apple-darwin" \
"x86_64-apple-ios" \
"x86_64-fortanix-unknown-sgx" \
"x86_64-linux-android" \
"x86_64-pc-solaris" \
"x86_64-pc-windows-gnu" \
"x86_64-pc-windows-msvc" \
"x86_64-rumprun-netbsd" \
"x86_64-sun-solaris" \
"x86_64-unknown-bitrig" \
"x86_64-unknown-cloudabi" \
"x86_64-unknown-dragonfly" \
"x86_64-unknown-freebsd" \
"x86_64-unknown-fuchsia" \
"x86_64-unknown-haiku" \
"x86_64-unknown-linux-gnu" \
"x86_64-unknown-linux-gnu" \
"x86_64-unknown-linux-gnux32" \
"x86_64-unknown-linux-musl" \
"x86_64-unknown-netbsd" \
"x86_64-unknown-openbsd" \
"x86_64-unknown-redox"
# The list below must be kept sorted alphabetically
printf "%s\n" \
"aarch64-apple-ios" \
"aarch64-linux-android" \
"aarch64-pc-windows-msvc" \
"aarch64-unknown-cloudabi" \
"aarch64-unknown-fuchsia" \
"aarch64-unknown-linux-gnu" \
"aarch64-unknown-linux-musl" \
"aarch64-unknown-redox" \
"armebv7r-none-eabi" \
"armebv7r-none-eabihf" \
"arm-linux-androideabi" \
"arm-unknown-linux-gnueabi" \
"arm-unknown-linux-gnueabihf" \
"arm-unknown-linux-musleabi" \
"arm-unknown-linux-musleabihf" \
"armv5te-unknown-linux-gnueabi" \
"armv5te-unknown-linux-musleabi" \
"armv7-apple-ios" \
"armv7-linux-androideabi" \
"armv7r-none-eabi" \
"armv7r-none-eabihf" \
"armv7s-apple-ios" \
"armv7-unknown-cloudabi-eabihf" \
"armv7-unknown-linux-gnueabi" \
"armv7-unknown-linux-gnueabihf" \
"armv7-unknown-linux-musleabi" \
"armv7-unknown-linux-musleabihf" \
"asmjs-unknown-emscripten" \
"i386-apple-ios" \
"i586-pc-windows-msvc" \
"i586-unknown-linux-gnu" \
"i586-unknown-linux-musl" \
"i686-apple-darwin" \
"i686-linux-android" \
"i686-pc-windows-gnu" \
"i686-pc-windows-msvc" \
"i686-unknown-cloudabi" \
"i686-unknown-freebsd" \
"i686-unknown-haiku" \
"i686-unknown-linux-gnu" \
"i686-unknown-linux-musl" \
"i686-unknown-netbsd" \
"le32-unknown-nacl" \
"mips64el-unknown-linux-gnuabi64" \
"mips64-unknown-linux-gnuabi64" \
"mipsel-unknown-linux-gnu" \
"mipsel-unknown-linux-musl" \
"mipsel-unknown-linux-uclibc" \
"mipsisa32r6el-unknown-linux-gnu" \
"mipsisa32r6-unknown-linux-gnu" \
"mipsisa64r6el-unknown-linux-gnuabi64" \
"mipsisa64r6-unknown-linux-gnuabi64" \
"mips-unknown-linux-gnu" \
"mips-unknown-linux-musl" \
"mips-unknown-linux-uclibc" \
"msp430-none-elf" \
"nvptx64-nvidia-cuda" \
"powerpc64le-unknown-linux-gnu" \
"powerpc64-unknown-linux-gnu" \
"powerpc-unknown-linux-gnu" \
"powerpc-unknown-linux-gnuspe" \
"riscv32imac-unknown-none-elf" \
"riscv32imc-unknown-none-elf" \
"riscv32i-unknown-none-elf" \
"riscv64gc-unknown-none-elf" \
"riscv64imac-unknown-none-elf" \
"s390x-unknown-linux-gnu" \
"sparc64-unknown-linux-gnu" \
"sparc64-unknown-netbsd" \
"sparc-unknown-linux-gnu" \
"sparcv9-sun-solaris" \
"thumbv6m-none-eabi" \
"thumbv7em-none-eabi" \
"thumbv7em-none-eabihf" \
"thumbv7m-none-eabi" \
"thumbv7neon-linux-androideabi" \
"thumbv7neon-unknown-linux-gnueabihf" \
"thumbv8m.base-none-eabi" \
"thumbv8m.main-none-eabi" \
"thumbv8m.main-none-eabihf" \
"wasm32-unknown-emscripten" \
"wasm32-unknown-unknown" \
"x86_64-apple-darwin" \
"x86_64-apple-ios" \
"x86_64-fortanix-unknown-sgx" \
"x86_64-linux-android" \
"x86_64-pc-solaris" \
"x86_64-pc-windows-gnu" \
"x86_64-pc-windows-msvc" \
"x86_64-rumprun-netbsd" \
"x86_64-sun-solaris" \
"x86_64-unknown-bitrig" \
"x86_64-unknown-cloudabi" \
"x86_64-unknown-dragonfly" \
"x86_64-unknown-freebsd" \
"x86_64-unknown-fuchsia" \
"x86_64-unknown-haiku" \
"x86_64-unknown-linux-gnu" \
"x86_64-unknown-linux-gnu" \
"x86_64-unknown-linux-gnux32" \
"x86_64-unknown-linux-musl" \
"x86_64-unknown-netbsd" \
"x86_64-unknown-openbsd" \
"x86_64-unknown-redox"
end
# Given n arguments, return the longest suffix common to all
function __rustup_common_suffix
if test (count $argv) -le 1
return
end
if test (count $argv) -le 1
return
end
set -l index -1
set -l min_length 65335
for arg in $argv
if test (string length "$arg") -lt $min_length
set min_length (string length "$arg")
end
end
set -l index -1
set -l min_length 65335
for arg in $argv
if test (string length "$arg") -lt $min_length
set min_length (string length "$arg")
end
end
set -l length 1
set -l suffix
set -l done 0
while test $done -eq 0 -a $length -le $min_length
set match (string match -r -- ".{$length}\$" "$argv[1]")
for arg in $argv[2..-1]
set -l value (string match -r -- ".{$length}\$" "$arg")
if test "$value" = "$match"
continue
else if string match -qr -- . "$suffix"
set done 1
break
else
# No common suffix
return 1
end
end
set suffix "$match"
set length (math $length + 1)
end
set -l length 1
set -l suffix
set -l done 0
while test $done -eq 0 -a $length -le $min_length
set match (string match -r -- ".{$length}\$" "$argv[1]")
for arg in $argv[2..-1]
set -l value (string match -r -- ".{$length}\$" "$arg")
if test "$value" = "$match"
continue
else if string match -qr -- . "$suffix"
set done 1
break
else
# No common suffix
return 1
end
end
set suffix "$match"
set length (math $length + 1)
end
printf "%s\n" "$suffix"
printf "%s\n" "$suffix"
end
# Strip result of __rustup_common_suffix
function __rustup_strip_common_suffix
set -l suffix (__rustup_common_suffix $argv)
printf "%s\n" $argv | string replace -r -- (string escape --style=regex -- "$suffix")\$ ""
set -l suffix (__rustup_common_suffix $argv)
printf "%s\n" $argv | string replace -r -- (string escape --style=regex -- "$suffix")\$ ""
end
# Strip result of __rustup_common_suffix, but require suffix to begin at a literal -
function __rustup_strip_common_suffix_strict
set -l suffix (__rustup_common_suffix $argv | string match -r -- "-.*")
printf "%s\n" $argv | string replace -r -- (string escape --style=regex -- "$suffix")\$ ""
set -l suffix (__rustup_common_suffix $argv | string match -r -- "-.*")
printf "%s\n" $argv | string replace -r -- (string escape --style=regex -- "$suffix")\$ ""
end
function __rustup_all_toolchains
printf "%s\n" $__rustup_channels
printf "%s\n" $__rustup_channels-(__rustup_triples)
printf "%s\n" $__rustup_channels
printf "%s\n" $__rustup_channels-(__rustup_triples)
end
# All valid toolchains excluding installed
function __rustup_installable_toolchains
comm -2 -3 (__rustup_all_toolchains | psub -F) (printf "%s\n" $__rustup_toolchains | psub -F) \
# Ignore warnings about lists not being in sorted order, as we are aware of their contents
2>/dev/null
comm -2 -3 (__rustup_all_toolchains | psub -F) (printf "%s\n" $__rustup_toolchains | psub -F) \
# Ignore warnings about lists not being in sorted order, as we are aware of their contents
2>/dev/null
end
function __rustup_installed_components
# If the user has supplied `--toolchain foo`, use it to filter the list
set -l toolchain (commandline -j | string replace -rf ".*\s--toolchain\s+(\S+)\s.*" '$1')
set -l toolchain_filter
if string match -qr . -- $toolchain
set toolchain_filter "--toolchain $toolchain"
end
# If the user has supplied `--toolchain foo`, use it to filter the list
set -l toolchain (commandline -j | string replace -rf ".*\s--toolchain\s+(\S+)\s.*" '$1')
set -l toolchain_filter
if string match -qr . -- $toolchain
set toolchain_filter "--toolchain $toolchain"
end
set -l installed (rustup component list --installed $toolchain_filter)
__rustup_strip_common_suffix_strict $installed
set -l installed (rustup component list --installed $toolchain_filter)
__rustup_strip_common_suffix_strict $installed
end
# Trim trailing attributes, e.g. "rust-whatever (default)" -> "rust-whatever"
@ -244,19 +244,19 @@ complete -c rustup -n "__fish_prev_arg_in self" -xa "update remove uninstall upg
complete -c rustup -n "__fish_prev_arg_in set" -xa "default-host profile help"
complete -c rustup -n "__fish_seen_subcommand_from toolchain; and __fish_prev_arg_in remove uninstall" \
-xa "$__rustup_toolchains $__rustup_toolchains_short"
-xa "$__rustup_toolchains $__rustup_toolchains_short"
complete -c rustup -n "__fish_seen_subcommand_from toolchain; and __fish_prev_arg_in add install" \
-xa "(__rustup_installable_toolchains)"
-xa "(__rustup_installable_toolchains)"
complete -c rustup -n "__fish_seen_subcommand_from component; and __fish_prev_arg_in remove uninstall" \
-xa "(__rustup_installed_components)"
-xa "(__rustup_installed_components)"
complete -c rustup -n "__fish_seen_subcommand_from component; and __fish_prev_arg_in add install" \
-xa "(__rustup_components)"
-xa "(__rustup_components)"
complete -c rustup -n "__fish_seen_subcommand_from show;" -xa "$rustup_show"
complete -c rustup -n "__fish_seen_subcommand_from set; and __fish_prev_arg_in default-host" \
-xa "(__rustup_triples)"
-xa "(__rustup_triples)"
complete -c rustup -n "__fish_seen_subcommand_from set; and __fish_prev_arg_in profile" \
-xa "$rustup_profiles"
@ -270,29 +270,29 @@ complete -f -c rustup -n '__fish_seen_subcommand_from doc' -a '(__fish_rustup_do
complete -f -c rustup -n '__fish_seen_subcommand_from doc' -a '(__fish_rustup_docs_modules)'
function __fish_rustup_docs_modules
set -l doc_path (__rustup_doc_path)
command find "$doc_path"/{std,core,alloc} -name index.html \
| string replace --regex "$doc_path/(.+)/index\.html" '$1\tModule' \
| string replace --all / ::
set -l doc_path (__rustup_doc_path)
command find "$doc_path"/{std,core,alloc} -name index.html \
| string replace --regex "$doc_path/(.+)/index\.html" '$1\tModule' \
| string replace --all / ::
end
function __fish_rustup_docs_keywords
set -l doc_path (__rustup_doc_path)
string replace --regex "$doc_path/std/keyword\.(.+)\.html" '$1\tKeyword' "$doc_path"/std/keyword.*.html
set -l doc_path (__rustup_doc_path)
string replace --regex "$doc_path/std/keyword\.(.+)\.html" '$1\tKeyword' "$doc_path"/std/keyword.*.html
end
function __fish_rustup_docs_primitives
set -l doc_path (__rustup_doc_path)
string replace --regex "$doc_path/std/primitive\.(.+)\.html" '$1\tPrimitive' "$doc_path"/std/primitive.*.html
set -l doc_path (__rustup_doc_path)
string replace --regex "$doc_path/std/primitive\.(.+)\.html" '$1\tPrimitive' "$doc_path"/std/primitive.*.html
end
function __fish_rustup_docs_macros
set -l doc_path (__rustup_doc_path)
string replace --regex "$doc_path/" '' "$doc_path"/{std,core,alloc}/macro.*.html \
| string replace --regex 'macro\.(.+)\.html' '$1\tMacro' \
| string replace --all / ::
set -l doc_path (__rustup_doc_path)
string replace --regex "$doc_path/" '' "$doc_path"/{std,core,alloc}/macro.*.html \
| string replace --regex 'macro\.(.+)\.html' '$1\tMacro' \
| string replace --all / ::
end
function __rustup_doc_path
rustup doc --path | string replace --regex '/[^/]*$' ''
rustup doc --path | string replace --regex '/[^/]*$' ''
end

View File

@ -1,20 +1,20 @@
if command -q wc && command wc --version >/dev/null 2>/dev/null
complete -c wc -s c -l bytes -d "Print byte count"
complete -c wc -s m -l chars -d "Print character count"
complete -c wc -s l -l lines -d "Print number of lines"
complete -c wc -s L -l max-line-length -d "Print length of longest line"
complete -c wc -s w -l words -d "Print number of words"
complete -c wc -l help -d "Display help and exit"
complete -c wc -l version -d "Display version and exit"
complete -c wc -s c -l bytes -d "Print byte count"
complete -c wc -s m -l chars -d "Print character count"
complete -c wc -s l -l lines -d "Print number of lines"
complete -c wc -s L -l max-line-length -d "Print length of longest line"
complete -c wc -s w -l words -d "Print number of words"
complete -c wc -l help -d "Display help and exit"
complete -c wc -l version -d "Display version and exit"
else
complete -c wc -s c -d "Print byte count"
complete -c wc -s m -d "Print character count"
complete -c wc -s l -d "Print number of lines"
complete -c wc -s w -d "Print number of words"
switch (uname -s)
case FreeBSD NetBSD
complete -c wc -s L -d "Print length of longest line"
case OpenBSD
complete -c wc -s h -d "Use B, KB, MB, GB, TB, PB, EB unit suffixes"
end
complete -c wc -s c -d "Print byte count"
complete -c wc -s m -d "Print character count"
complete -c wc -s l -d "Print number of lines"
complete -c wc -s w -d "Print number of words"
switch (uname -s)
case FreeBSD NetBSD
complete -c wc -s L -d "Print length of longest line"
case OpenBSD
complete -c wc -s h -d "Use B, KB, MB, GB, TB, PB, EB unit suffixes"
end
end

View File

@ -17,7 +17,7 @@ complete -c zpaq -f -n "not $seen $commands" -a l -d "list"
complete -c zpaq -f -n "not $seen $commands" -a list -d "List or compare external files to archive by dates"
#options
complete -c zpaq -x -n "$seen $commands" -o all -a N -d "Extract/list versions in N [4] digit directories"
complete -c zpaq -x -n "$seen $commands" -o all -a N -d "Extract/list versions in N [4] digit directories"
complete -c zpaq -f -n "$seen $commands" -o f -d "-force"
complete -c zpaq -f -n "$seen $command1" -o force -d "Append files if contents have changed"
complete -c zpaq -f -n "$seen $command2" -o force -d "Compare file contents instead of dates"

View File

@ -9,7 +9,7 @@ function __fish_complete_gpg_key_id -d 'Complete using gpg key ids' -a __fish_co
case "uid*"
echo $garbage | cut -d ":" -f 10 | sed -e "s/\\\x3a/:/g" | read uid
printf "%s\t%s\n" $keyid $uid
# Extract key fingerprints (no subkeys)
# Extract key fingerprints (no subkeys)
case "pub*"
echo $garbage | cut -d ":" -f 5 | read keyid
end

View File

@ -9,8 +9,8 @@ function __fish_man_page
end
#Skip `sudo` and display then manpage of following command
while set -q args[2]
and test $args[1] = "sudo"
while set -q args[2]
and test $args[1] = "sudo"
set args $args[2..-1]
end

View File

@ -14,13 +14,13 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
# Ignore comments, own IP addresses (127.*, 0.0[.0[.0]], ::1), non-host IPs (fe00::*, ff00::*),
# and leading/trailing whitespace. Split results on whitespace to handle multiple aliases for
# one IP.
string replace -irf '^\s*?(?!(?:#|0\.|127\.|ff0|fe0|::1))\S+\s*(.*?)\s*$' '$1' |
string split ' '
string replace -irf '^\s*?(?!(?:#|0\.|127\.|ff0|fe0|::1))\S+\s*(.*?)\s*$' '$1' |
string split ' '
# Print nfs servers from /etc/fstab
if test -r /etc/fstab
string match -r '^\s*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3]:|^[a-zA-Z\.]*:' </etc/fstab |
string replace -r ':.*' ''
string replace -r ':.*' ''
end
# Check hosts known to ssh.
@ -121,17 +121,17 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
read -z <$file
end
end |
# Ignore hosts that are hashed, commented or @-marked and strip the key
# Handle multiple comma-separated hostnames sharing a key, too.
#
# This one regex does everything we need, finding all matches including comma-separated
# values, but fish does not let us print only a capturing group without the entire match,
# and we can't use `string replace` instead (because CSV then fails).
# string match -ar "(?:^|,)(?![@|*!])\[?([^ ,:\]]+)\]?"
#
# Instead, manually piece together the regular expressions
string match -v -r '^\s*[!*|@#]' | string replace -r '^\s*(\S+) .*' '$1' |
string split ',' | string replace -r '\[?([^:\]]+).*' '$1'
# Ignore hosts that are hashed, commented or @-marked and strip the key
# Handle multiple comma-separated hostnames sharing a key, too.
#
# This one regex does everything we need, finding all matches including comma-separated
# values, but fish does not let us print only a capturing group without the entire match,
# and we can't use `string replace` instead (because CSV then fails).
# string match -ar "(?:^|,)(?![@|*!])\[?([^ ,:\]]+)\]?"
#
# Instead, manually piece together the regular expressions
string match -v -r '^\s*[!*|@#]' | string replace -r '^\s*(\S+) .*' '$1' |
string split ',' | string replace -r '\[?([^:\]]+).*' '$1'
return 0
end

View File

@ -50,9 +50,10 @@ def is_wsl():
return True
return False
def is_termux():
""" Return whether we are running under the Termux application for Android"""
return 'com.termux' in os.environ['PATH'] and find_executable('termux-open-url')
return "com.termux" in os.environ["PATH"] and find_executable("termux-open-url")
# Disable CLI web browsers
@ -1195,7 +1196,11 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_save_abbreviation(self, abbreviation):
out, err = run_fish_cmd(
# Remove one layer of single-quotes because escape_fish_cmd adds them back.
"abbr --add %s %s" % (escape_fish_cmd(abbreviation["word"].strip("'")), escape_fish_cmd(abbreviation["phrase"].strip("'")))
"abbr --add %s %s"
% (
escape_fish_cmd(abbreviation["word"].strip("'")),
escape_fish_cmd(abbreviation["phrase"].strip("'")),
)
)
if err:
return err