diff --git a/share/completions/7z.fish b/share/completions/7z.fish index 2175ac268..94bb36ac5 100644 --- a/share/completions/7z.fish +++ b/share/completions/7z.fish @@ -1,16 +1,16 @@ # Completions for p7zip # Commands -complete -f -c 7z -n __fish_use_subcommand -a a -d "Add" -complete -f -c 7z -n __fish_use_subcommand -a b -d "Benchmark" -complete -f -c 7z -n __fish_use_subcommand -a d -d "Delete" -complete -f -c 7z -n __fish_use_subcommand -a e -d "Extract" -complete -f -c 7z -n __fish_use_subcommand -a h -d "Hash" +complete -f -c 7z -n __fish_use_subcommand -a a -d Add +complete -f -c 7z -n __fish_use_subcommand -a b -d Benchmark +complete -f -c 7z -n __fish_use_subcommand -a d -d Delete +complete -f -c 7z -n __fish_use_subcommand -a e -d Extract +complete -f -c 7z -n __fish_use_subcommand -a h -d Hash complete -f -c 7z -n __fish_use_subcommand -a i -d "Show information about supported formats" -complete -f -c 7z -n __fish_use_subcommand -a l -d "List" -complete -f -c 7z -n __fish_use_subcommand -a rn -d "Rename" -complete -f -c 7z -n __fish_use_subcommand -a t -d "Test" -complete -f -c 7z -n __fish_use_subcommand -a u -d "Update" +complete -f -c 7z -n __fish_use_subcommand -a l -d List +complete -f -c 7z -n __fish_use_subcommand -a rn -d Rename +complete -f -c 7z -n __fish_use_subcommand -a t -d Test +complete -f -c 7z -n __fish_use_subcommand -a u -d Update complete -f -c 7z -n __fish_use_subcommand -a x -d "Extract with full paths" # Switches diff --git a/share/completions/configure.fish b/share/completions/configure.fish index 00ca63fbe..2ab798602 100644 --- a/share/completions/configure.fish +++ b/share/completions/configure.fish @@ -23,52 +23,52 @@ function __fish_parse_configure # Just fish's `./configure --help` takes ~350ms to run, before parsing # The following chain attempts to extract the help message: cat $argv[1] | tr \n \u0e | sed -n 's/.*Report the --help message\(.*\?\)ac_status.*/\1/; s/ac_status.*//p' | tr \u0e \n | - while test "$next_line" != "" || read -lL next_line - # In autoconfigure scripts, the first column wraps at 26 chars - # echo next_line: $next_line - # echo old_line: $line - if test "$line" = "" - set line $next_line - set next_line "" # mark it as consumed - continue - else if string match -qr '^( |\t){2,}[^-]\S*' -- $next_line - # echo "continuation line found. Old value of line: " \"$line\" - set line "$line "(string trim $next_line) - set next_line "" # mark it as consumed - continue - end - - # echo line: $line - - # Search for one or more strings starting with `-` separated by commas - if string replace -fr '^\s+(-.*?)\s+([^\s\-].*)' '$1\n$2' -- $line | read -lL opts description - for opt in (string split -n , -- $opts | string trim) - - if string match -qr -- '--[a-z_0-9-]+=\[.*\]' $opt - # --option=[OPTIONAL_VALUE] - string replace -r -- '(--[a-z_0-9-]+)=.*' '$1' $opt | read opt - else if string match -qr -- '--[a-z_0-9-]+\[=.*\]' $opt - # --option[=OPTIONAL_VALUE] - string replace -r -- '(--[a-z_0-9-]+)\[=.*' '$1' $opt | read opt - else if string match -qr -- '--[a-z_0-9-]+=[A-Z]+' $opt - # --option=CLASS_OF_VALUE (eg FILE or DIR) - string replace -r -- '(--[a-z_0-9-]+)=.*' '$1' $opt | read opt - else if string match -qr -- '--[a-z_0-9-]+=\S+' $opt - # --option=literal_value, leave as-is - else if string match -qr -- '--[a-z_0-9-]+$' $opt - # long option, leave as-is - else if string match -qr -- '-[^-]$' $opt - # short option, leave as-is - else - continue - end - - echo "$opt"\t"$description" # parsed by `complete` as value and description + while test "$next_line" != "" || read -lL next_line + # In autoconfigure scripts, the first column wraps at 26 chars + # echo next_line: $next_line + # echo old_line: $line + if test "$line" = "" + set line $next_line + set next_line "" # mark it as consumed + continue + else if string match -qr '^( |\t){2,}[^-]\S*' -- $next_line + # echo "continuation line found. Old value of line: " \"$line\" + set line "$line "(string trim $next_line) + set next_line "" # mark it as consumed + continue end - end - set line "" - end + # echo line: $line + + # Search for one or more strings starting with `-` separated by commas + if string replace -fr '^\s+(-.*?)\s+([^\s\-].*)' '$1\n$2' -- $line | read -lL opts description + for opt in (string split -n , -- $opts | string trim) + + if string match -qr -- '--[a-z_0-9-]+=\[.*\]' $opt + # --option=[OPTIONAL_VALUE] + string replace -r -- '(--[a-z_0-9-]+)=.*' '$1' $opt | read opt + else if string match -qr -- '--[a-z_0-9-]+\[=.*\]' $opt + # --option[=OPTIONAL_VALUE] + string replace -r -- '(--[a-z_0-9-]+)\[=.*' '$1' $opt | read opt + else if string match -qr -- '--[a-z_0-9-]+=[A-Z]+' $opt + # --option=CLASS_OF_VALUE (eg FILE or DIR) + string replace -r -- '(--[a-z_0-9-]+)=.*' '$1' $opt | read opt + else if string match -qr -- '--[a-z_0-9-]+=\S+' $opt + # --option=literal_value, leave as-is + else if string match -qr -- '--[a-z_0-9-]+$' $opt + # long option, leave as-is + else if string match -qr -- '-[^-]$' $opt + # short option, leave as-is + else + continue + end + + echo "$opt"\t"$description" # parsed by `complete` as value and description + end + end + + set line "" + end end complete -c configure -s h -l help -x -a "short recursive" -d "Display help and exit" diff --git a/share/completions/k3d.fish b/share/completions/k3d.fish index fd7ad8fe1..f4da4cb00 100644 --- a/share/completions/k3d.fish +++ b/share/completions/k3d.fish @@ -15,20 +15,20 @@ function __fish_k3d_print_nodes --description 'Print a list of k3d nodes' k3d node list --no-headers | awk '{print $1}' end -complete -f -c k3d -n '__fish_k3d_no_subcommand' -s h -l help -d "More information about a command" -complete -f -c k3d -n '__fish_k3d_no_subcommand' -l version -d "Show k3d and default k3s version" -complete -f -c k3d -n '__fish_k3d_no_subcommand' -a cluster -d "Manage cluster(s)" -complete -f -c k3d -n '__fish_k3d_no_subcommand' -a version -d "Show k3d and default k3s version" -complete -f -c k3d -n '__fish_k3d_no_subcommand' -a image -d "Handle container images" -complete -f -c k3d -n '__fish_k3d_no_subcommand' -a kubeconfig -d "Manage kubeconfig(s)" -complete -f -c k3d -n '__fish_k3d_no_subcommand' -a node -d "Manage node(s)" +complete -f -c k3d -n __fish_k3d_no_subcommand -s h -l help -d "More information about a command" +complete -f -c k3d -n __fish_k3d_no_subcommand -l version -d "Show k3d and default k3s version" +complete -f -c k3d -n __fish_k3d_no_subcommand -a cluster -d "Manage cluster(s)" +complete -f -c k3d -n __fish_k3d_no_subcommand -a version -d "Show k3d and default k3s version" +complete -f -c k3d -n __fish_k3d_no_subcommand -a image -d "Handle container images" +complete -f -c k3d -n __fish_k3d_no_subcommand -a kubeconfig -d "Manage kubeconfig(s)" +complete -f -c k3d -n __fish_k3d_no_subcommand -a node -d "Manage node(s)" complete -f -c k3d -n '__fish_seen_subcommand_from cluster' -a create -d "Create a new cluster" complete -f -c k3d -n '__fish_seen_subcommand_from cluster' -a list -d "List cluster(s)" complete -f -c k3d -n '__fish_seen_subcommand_from cluster' -a delete -d "Delete cluster(s)" complete -f -c k3d -n '__fish_seen_subcommand_from cluster' -a start -d "Start existing k3d cluster(s)" complete -f -c k3d -n '__fish_seen_subcommand_from cluster' -a stop -d "Stop existing k3d cluster(s)" -complete -f -c k3d -n '__fish_seen_subcommand_from cluster; and __fish_seen_subcommand_from delete start stop' -a '(__fish_k3d_print_clusters)' -d "Cluster" +complete -f -c k3d -n '__fish_seen_subcommand_from cluster; and __fish_seen_subcommand_from delete start stop' -a '(__fish_k3d_print_clusters)' -d Cluster complete -f -c k3d -n '__fish_seen_subcommand_from cluster' -s h -l help -d "Print usage" complete -f -c k3d -n '__fish_seen_subcommand_from image' -a import -d "Import image(s) from docker into k3d cluster(s)" @@ -37,7 +37,7 @@ complete -f -c k3d -n '__fish_seen_subcommand_from image' -s h -l help -d "Print complete -f -c k3d -n '__fish_seen_subcommand_from kubeconfig' -a get -d "Get kubeconfig from cluster(s)" complete -f -c k3d -n '__fish_seen_subcommand_from kubeconfig' -a merge -d "Merge/write kubeconfig(s) from cluster(s) into existing kubeconfig/file" -complete -f -c k3d -n '__fish_seen_subcommand_from kubeconfig get merge' -a '(__fish_k3d_print_clusters)' -d "Cluster" +complete -f -c k3d -n '__fish_seen_subcommand_from kubeconfig get merge' -a '(__fish_k3d_print_clusters)' -d Cluster complete -f -c k3d -n '__fish_seen_subcommand_from kubeconfig get merge' -s a -l all -d "Get kubeconfig from all existing clusters" complete -f -c k3d -n '__fish_seen_subcommand_from kubeconfig' -s h -l help -d "Print usage" @@ -46,5 +46,5 @@ complete -f -c k3d -n '__fish_seen_subcommand_from node' -a delete -d "Delete no complete -f -c k3d -n '__fish_seen_subcommand_from node' -a list -d "List node(s)" complete -f -c k3d -n '__fish_seen_subcommand_from node' -a start -d "Start an existing k3d node" complete -f -c k3d -n '__fish_seen_subcommand_from node' -a stop -d "Stop an existing k3d node" -complete -f -c k3d -n '__fish_seen_subcommand_from node; and __fish_seen_subcommand_from delete start stop' -a '(__fish_k3d_print_nodes)' -d "Node" +complete -f -c k3d -n '__fish_seen_subcommand_from node; and __fish_seen_subcommand_from delete start stop' -a '(__fish_k3d_print_nodes)' -d Node complete -f -c k3d -n '__fish_seen_subcommand_from node' -s h -l help -d "Print usage" diff --git a/share/completions/make.fish b/share/completions/make.fish index 109af20f8..1d8c0ccbb 100644 --- a/share/completions/make.fish +++ b/share/completions/make.fish @@ -12,7 +12,7 @@ function __fish_print_make_targets --argument-names directory file if make --version 2>/dev/null | string match -q 'GNU*' # https://stackoverflow.com/a/26339924 make $makeflags -pRrq : 2>/dev/null | - awk -F: '/^# Files/,/^# Finished Make data base/ { + awk -F: '/^# Files/,/^# Finished Make data base/ { if ($1 == "# Not a target") skip = 1; if ($1 !~ "^[#.\t]") { if (!skip) print $1; skip=0 } }' 2>/dev/null diff --git a/share/completions/mpc.fish b/share/completions/mpc.fish index efec4d0b3..99c5f4c31 100644 --- a/share/completions/mpc.fish +++ b/share/completions/mpc.fish @@ -88,6 +88,6 @@ complete -c mpc -n "__fish_seen_subcommand_from add insert" -a "(mpc listall)" complete -c mpc -n "__fish_seen_subcommand_from playlist" -a "(mpc lsplaylists)" complete -c mpc -n "__fish_seen_subcommand_from consume random repeat single" -a "on off" -complete -c mpc -n "__fish_seen_subcommand_from replaygain" -a "off track album" +complete -c mpc -n "__fish_seen_subcommand_from replaygain" -a "off track album" # TODO: sticker subcommand diff --git a/share/completions/snap.fish b/share/completions/snap.fish index f37b81575..beb253413 100644 --- a/share/completions/snap.fish +++ b/share/completions/snap.fish @@ -3,8 +3,8 @@ function __fish_snap_no_subcommand -d 'Test if snap has yet to be given the subcommand' for i in (commandline -opc) if contains -- $i abort ack alias aliases buy changes connect disable disconnect download\ - enable find get help info install interfaces known list login logout prefer refresh remove\ - revert run set tasks try unalias version watch + enable find get help info install interfaces known list login logout prefer refresh remove\ + revert run set tasks try unalias version watch return 1 end end @@ -82,7 +82,7 @@ end function __fish_snap_no_assertion -d 'Check that no assertion type is used yet' for i in (commandline -opc) if contains -- $i account account-key model serial snap-declaration snap-build snap-revision\ - system-user validation + system-user validation return 1 end end @@ -103,7 +103,7 @@ function __fish_snap_assertion set -e argv[1] complete -f -c snap -n '__fish_snap_using_subcommand known; and __fish_snap_no_assertion' -a $assertion complete -f -c snap -n "__fish_snap_using_assertion $assertion" -a "(__fish_snap_filters $assertion)"\ - -d Filter + -d Filter end function __fish_snap_filters -d 'List assertion filters' diff --git a/share/completions/udevadm.fish b/share/completions/udevadm.fish index 7a2044ef6..f1f70dfcf 100644 --- a/share/completions/udevadm.fish +++ b/share/completions/udevadm.fish @@ -1,11 +1,11 @@ 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_first_token -xa "$commands" complete -c udevadm -s h -l help -d "Show help" complete -c udevadm -s V -l version -d "Show version info" # udevadm info -set -l query_type "name\t'Name of device node'" "symlink\t'Pointing to node'" "path\t'sysfs device path'" "property\t'Device properties'" "all" +set -l query_type "name\t'Name of device node'" "symlink\t'Pointing to node'" "path\t'sysfs device path'" "property\t'Device properties'" all complete -c udevadm -n '__fish_seen_subcommand_from info' -s q -l query -d "Query device information" -xa "$query_type" complete -c udevadm -n '__fish_seen_subcommand_from info' -s p -l path -d "sysfs device path" -f complete -c udevadm -n '__fish_seen_subcommand_from info' -s n -l name -d "Node or symlink name" diff --git a/share/completions/yadm.fish b/share/completions/yadm.fish index aac2a5bbf..cf84fcd4c 100644 --- a/share/completions/yadm.fish +++ b/share/completions/yadm.fish @@ -86,21 +86,21 @@ complete -F -r -c yadm -l yadm-archive -d 'Override location of yadm encrypted f complete -F -r -c yadm -l yadm-bootstrap -d 'Override location of yadm bootstrap program' # Subcommands -complete -f -c yadm -n "__fish_yadm_needs_command" -a version -d 'Print yadm version' -complete -f -c yadm -n "__fish_yadm_needs_command" -a init -d 'Initialize new repository for tracking dotfiles' -complete -f -c yadm -n "__fish_yadm_needs_command" -a config -d 'Manage configuration for yadm' -complete -f -c yadm -n "__fish_yadm_needs_command" -a list -d 'Print list of files managed by yadm' -complete -f -c yadm -n "__fish_yadm_needs_command" -a bootstrap -d 'Execute bootstrap script' -complete -f -c yadm -n "__fish_yadm_needs_command" -a encrypt -d 'Encrypt files matched by encrypt spec file' -complete -f -c yadm -n "__fish_yadm_needs_command" -a decrypt -d 'Decrypt files matched by encrypt spec file' -complete -f -c yadm -n "__fish_yadm_needs_command" -a alt -d 'Setup and process alternate files' -complete -f -c yadm -n "__fish_yadm_needs_command" -a perms -d 'Update permissions' -complete -f -c yadm -n "__fish_yadm_needs_command" -a enter -d 'Run sub-shell with all git variables set' -complete -f -c yadm -n "__fish_yadm_needs_command" -a git-crypt -d 'Pass options to git-crypt if installed' -complete -f -c yadm -n "__fish_yadm_needs_command" -a gitconfig -d 'Pass options to the git config command' -complete -f -c yadm -n "__fish_yadm_needs_command" -a upgrade -d 'Migrate from v1 to v2' -complete -f -c yadm -n "__fish_yadm_needs_command" -a introspect -d 'Report internal yadm data' -complete -f -c yadm -n "__fish_yadm_needs_command" -a clone -d 'Clone remote repository for tracking dotfiles' +complete -f -c yadm -n __fish_yadm_needs_command -a version -d 'Print yadm version' +complete -f -c yadm -n __fish_yadm_needs_command -a init -d 'Initialize new repository for tracking dotfiles' +complete -f -c yadm -n __fish_yadm_needs_command -a config -d 'Manage configuration for yadm' +complete -f -c yadm -n __fish_yadm_needs_command -a list -d 'Print list of files managed by yadm' +complete -f -c yadm -n __fish_yadm_needs_command -a bootstrap -d 'Execute bootstrap script' +complete -f -c yadm -n __fish_yadm_needs_command -a encrypt -d 'Encrypt files matched by encrypt spec file' +complete -f -c yadm -n __fish_yadm_needs_command -a decrypt -d 'Decrypt files matched by encrypt spec file' +complete -f -c yadm -n __fish_yadm_needs_command -a alt -d 'Setup and process alternate files' +complete -f -c yadm -n __fish_yadm_needs_command -a perms -d 'Update permissions' +complete -f -c yadm -n __fish_yadm_needs_command -a enter -d 'Run sub-shell with all git variables set' +complete -f -c yadm -n __fish_yadm_needs_command -a git-crypt -d 'Pass options to git-crypt if installed' +complete -f -c yadm -n __fish_yadm_needs_command -a gitconfig -d 'Pass options to the git config command' +complete -f -c yadm -n __fish_yadm_needs_command -a upgrade -d 'Migrate from v1 to v2' +complete -f -c yadm -n __fish_yadm_needs_command -a introspect -d 'Report internal yadm data' +complete -f -c yadm -n __fish_yadm_needs_command -a clone -d 'Clone remote repository for tracking dotfiles' # Options for subcommands complete -f -c yadm -n "__fish_yadm_using_command init" -s f -d 'Overwrite existing repository' diff --git a/share/functions/__fish_complete_clang.fish b/share/functions/__fish_complete_clang.fish index 7e7a4b897..1a493cd80 100644 --- a/share/functions/__fish_complete_clang.fish +++ b/share/functions/__fish_complete_clang.fish @@ -10,6 +10,6 @@ function __fish_complete_clang set -l clang (commandline -o)[1] # first get the completions from clang, with the prefix separated from the value by a comma $clang --autocomplete=(commandline -ct | string unescape | string replace -- "$prefix" "$prefix,") 2>/dev/null | - # and put it in a format that fish understands - string replace -r -- '^([^ ]+)\s*(.*)' "$prefix\$1\t\$2" + # and put it in a format that fish understands + string replace -r -- '^([^ ]+)\s*(.*)' "$prefix\$1\t\$2" end diff --git a/share/functions/__fish_complete_mount_opts.fish b/share/functions/__fish_complete_mount_opts.fish index 2e082a5b4..c1f91672e 100644 --- a/share/functions/__fish_complete_mount_opts.fish +++ b/share/functions/__fish_complete_mount_opts.fish @@ -18,124 +18,123 @@ end function __fish_complete_mount_opts set -l fish_mount_opts\ - async\t'Use asynchronous I/O'\ - atime\t'Update time on each access'\ - noatime\t'Do not update time on each access'\ - auto\t'Mounted with'\ - noauto\t'Not mounted by -a'\ - defaults\t'Use default options'\ - dev\t'Interpret character/block special devices'\ - nodev\t'Do not interpret character/block special devices'\ - diratime\t'Update directory inode access time'\ - nodiratime\t'Don\'t update directory inode access time'\ - dirsync\t'Use synchronous directory operations'\ - exec\t'Permit executables'\ - noexec\t'Do not permit executables'\ - group\t'Any user within device group may mount'\ - iversion\t'Increment i_version field on inode modification'\ - noiversion\t'Don\'t increment i_version field on inode modification'\ - mand\t'Allow mandatory locks'\ - nomand\t'Don\'t allow mandatory locks'\ - _netdev\t'Filesystem uses network'\ - nofail\t'Don\'t report errors'\ - relatime\t'Update inode access times'\ - norelatime\t'Don\'t update inode access times'\ - strictatime\ - nostrictatime\ - lazytime\ - nolazytime\ - suid\t'Allow suid bits'\ - nosuid\t'Ignore suid bits'\ - silent\ - loud\ - owner\ - remount\t'Remount read-only filesystem'\ - ro\t'Mount read-only'\ - rw\t'Mount read-write'\ - sync\t'Use synchronous I/O'\ - user\t'Any user may mount'\ - nouser\t'Only root may mount'\ - users\t'Any user may mount and unmount'\ - protect\ - usemp\ - verbose\ - {grp,no,usr,}quota\ - autodefrag\ - compress\ - compress-force\ - degraded\ - discard\ - enospc_debug\ - flushoncommit\ - inode_cache\ - context=\t'Set SELinux context'\ - uid=\ - gid=\ - ownmask=\ - othmask=\ - setuid=\ - setgid=\ - mode=\ - prefix=\ - volume=\ - reserved=\ - root=\ - bs=\ - alloc_start=\ - check_int{,_data,_print,_mask}=\ - commit=\ - compress=\ - compress-force=\ - device=\ - fatal_errors=\ - max_inline=\ - metadata_ratio=\ - noacl\ - nobarrier\ - nodatacow\ - nodatasum\ - notreelog\ - recovery\ - rescan_uuid_tree\ - skip_balance\ - nospace_cache\ - clear_cache\ - ssd\ - nossd\ - ssd_spread\ - subvol=\ - subvolrootid=\ - thread_pool=\ - user_subvol_rm_allowed\ - acl\ - noacl\ - bsddf\ - minixdf\ - check=none\ - nocheck\ - debug\ - errors={continue,remount-ro,panic}\ - grpid\ - bsdgroups\ - bsdgroups\ - bsdgroups\ - nouid32\ - grpquota\ - grpquota\ - resgid=\ - resuid=\ - sb=\ - {user,nouser}_xattr\ - journal={update,unum}\ - journal{_dev,_path}=\ - norecovery\ - noload\ - data={journal,ordered,writeback}\ - data_err={ignore,abort}\ - barrier={0,1}\ - user_xattr\ - acl\ - + async\t'Use asynchronous I/O'\ + atime\t'Update time on each access'\ + noatime\t'Do not update time on each access'\ + auto\t'Mounted with'\ + noauto\t'Not mounted by -a'\ + defaults\t'Use default options'\ + dev\t'Interpret character/block special devices'\ + nodev\t'Do not interpret character/block special devices'\ + diratime\t'Update directory inode access time'\ + nodiratime\t'Don\'t update directory inode access time'\ + dirsync\t'Use synchronous directory operations'\ + exec\t'Permit executables'\ + noexec\t'Do not permit executables'\ + group\t'Any user within device group may mount'\ + iversion\t'Increment i_version field on inode modification'\ + noiversion\t'Don\'t increment i_version field on inode modification'\ + mand\t'Allow mandatory locks'\ + nomand\t'Don\'t allow mandatory locks'\ + _netdev\t'Filesystem uses network'\ + nofail\t'Don\'t report errors'\ + relatime\t'Update inode access times'\ + norelatime\t'Don\'t update inode access times'\ + strictatime\ + nostrictatime\ + lazytime\ + nolazytime\ + suid\t'Allow suid bits'\ + nosuid\t'Ignore suid bits'\ + silent\ + loud\ + owner\ + remount\t'Remount read-only filesystem'\ + ro\t'Mount read-only'\ + rw\t'Mount read-write'\ + sync\t'Use synchronous I/O'\ + user\t'Any user may mount'\ + nouser\t'Only root may mount'\ + users\t'Any user may mount and unmount'\ + protect\ + usemp\ + verbose\ + {grp,no,usr,}quota\ + autodefrag\ + compress\ + compress-force\ + degraded\ + discard\ + enospc_debug\ + flushoncommit\ + inode_cache\ + context=\t'Set SELinux context'\ + uid=\ + gid=\ + ownmask=\ + othmask=\ + setuid=\ + setgid=\ + mode=\ + prefix=\ + volume=\ + reserved=\ + root=\ + bs=\ + alloc_start=\ + check_int{,_data,_print,_mask}=\ + commit=\ + compress=\ + compress-force=\ + device=\ + fatal_errors=\ + max_inline=\ + metadata_ratio=\ + noacl\ + nobarrier\ + nodatacow\ + nodatasum\ + notreelog\ + recovery\ + rescan_uuid_tree\ + skip_balance\ + nospace_cache\ + clear_cache\ + ssd\ + nossd\ + ssd_spread\ + subvol=\ + subvolrootid=\ + thread_pool=\ + user_subvol_rm_allowed\ + acl\ + noacl\ + bsddf\ + minixdf\ + check=none\ + nocheck\ + debug\ + errors={continue,remount-ro,panic}\ + grpid\ + bsdgroups\ + bsdgroups\ + bsdgroups\ + nouid32\ + grpquota\ + grpquota\ + resgid=\ + resuid=\ + sb=\ + {user,nouser}_xattr\ + journal={update,unum}\ + journal{_dev,_path}=\ + norecovery\ + noload\ + data={journal,ordered,writeback}\ + data_err={ignore,abort}\ + barrier={0,1}\ + user_xattr\ + acl\ set -l token (commandline -tc | string replace -r '^-o' -- '') set -l args (string split , -- $token) diff --git a/share/functions/__fish_complete_wireshark.fish b/share/functions/__fish_complete_wireshark.fish index e208d3e81..4b82665d9 100644 --- a/share/functions/__fish_complete_wireshark.fish +++ b/share/functions/__fish_complete_wireshark.fish @@ -34,7 +34,7 @@ function __fish_tshark_decode_as else if string match -rq -- '(==|,)' $tok set -l tok_no_comma (string replace -r -- ',.*$' '' $tok) command tshark -d (string replace -r -- '^-d' '' $tok) 2>| - string replace -rf -- "^\t(\S+) \(?([^\)]*)\)?\$" "$tok_no_comma,\$1\t\$2" + string replace -rf -- "^\t(\S+) \(?([^\)]*)\)?\$" "$tok_no_comma,\$1\t\$2" else command tshark -d . 2>| string replace -rf -- "^\t(\S+) \(?([^\)]*)\)?\$" '$1==\t$2' end diff --git a/share/functions/__fish_print_commands.fish b/share/functions/__fish_print_commands.fish index 0c79f354a..e55bb8aa1 100644 --- a/share/functions/__fish_print_commands.fish +++ b/share/functions/__fish_print_commands.fish @@ -2,8 +2,8 @@ function __fish_print_commands --description "Print a list of documented fish co if test -d $__fish_data_dir/man/man1/ for file in $__fish_data_dir/man/man1/**.1* string replace -r '.*/' '' -- $file | - string replace -r '.1(.gz)?$' '' | - string match -rv '^fish-(?:completions|doc|tutorial|faq)$' + string replace -r '.1(.gz)?$' '' | + string match -rv '^fish-(?:completions|doc|tutorial|faq)$' end end end diff --git a/share/functions/__fish_print_help.fish b/share/functions/__fish_print_help.fish index 8cc178dc9..f7b893003 100644 --- a/share/functions/__fish_print_help.fish +++ b/share/functions/__fish_print_help.fish @@ -112,20 +112,20 @@ function __fish_print_help --description "Print help message for the specified f end end end | string replace -ra '^ ' '' | ul | # post-process with `ul`, to interpret the old-style grotty escapes - begin - set -l pager less - set -q PAGER - and echo $PAGER | read -at pager - not isatty stdout - and set pager cat # cannot use a builtin here - # similar to man, but add -F to quit paging when the help output is brief (#6227) - set -xl LESS isrFX - # less options: - # -i (--ignore-case) search case-insensitively, like man - # -s (--squeeze-blank-lines) not strictly necessary since we already do that above - # -r (--raw-control-chars) to display bold, underline and colors - # -F (--quit-if-one-screen) to maintain the non-paging behavior for small outputs - # -X (--no-init) not sure if this is needed but git uses it - $pager - end + begin + set -l pager less + set -q PAGER + and echo $PAGER | read -at pager + not isatty stdout + and set pager cat # cannot use a builtin here + # similar to man, but add -F to quit paging when the help output is brief (#6227) + set -xl LESS isrFX + # less options: + # -i (--ignore-case) search case-insensitively, like man + # -s (--squeeze-blank-lines) not strictly necessary since we already do that above + # -r (--raw-control-chars) to display bold, underline and colors + # -F (--quit-if-one-screen) to maintain the non-paging behavior for small outputs + # -X (--no-init) not sure if this is needed but git uses it + $pager + end end diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 3be453d1f..445644768 100644 --- a/share/functions/__fish_print_hostnames.fish +++ b/share/functions/__fish_print_hostnames.fish @@ -11,16 +11,16 @@ function __fish_print_hostnames -d "Print a list of known hostnames" test -r /etc/hosts && read -z /dev/null end | - # 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 ' ' + # 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 ' ' # 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\.]*:' Package - xbps-query -Rsl | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' > $cache_file & + xbps-query -Rsl | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' >$cache_file & return else xbps-query -l | sed 's/^.. \([^ ]*\)-.* .*/\1/' # TODO: actually put package versions in tab for locally installed packages diff --git a/share/functions/fish_git_prompt.fish b/share/functions/fish_git_prompt.fish index d9e529279..1b9bb19d9 100644 --- a/share/functions/fish_git_prompt.fish +++ b/share/functions/fish_git_prompt.fish @@ -663,7 +663,8 @@ function __fish_git_prompt_set_char end if set -q argv[3] - and begin set -q __fish_git_prompt_show_informative_status + and begin + set -q __fish_git_prompt_show_informative_status or set -q __fish_git_prompt_use_informative_chars end set char $argv[3] diff --git a/share/functions/fish_prompt.fish b/share/functions/fish_prompt.fish index 9ff3cf25c..f733131a1 100644 --- a/share/functions/fish_prompt.fish +++ b/share/functions/fish_prompt.fish @@ -25,7 +25,7 @@ function fish_prompt --description 'Write out the prompt' end # Write pipestatus - set -l bold_flag '--bold' + set -l bold_flag --bold if test $__fish_prompt_status_generation = $status_generation set bold_flag end