diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2e6114104..3f1d804fa 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,28 @@ +fish 3.7.1 (released March 19, 2024) +==================================== + +This release of fish fixes the following problems identified in fish 3.7.0: + +- Deleting the last history entry via ``history delete`` works again (:issue:`10190`). +- Wildcards (``*``) will no longer sometimes generate paths that did not exist (:issue:`10205`). + +This release also contains some improvements: + +- A crash when trying to run an ELF program with a missing interpreter has been fixed. This crashed in the process after fork, so did not affect the fish process that tried to start the program (:issue:`10199`). +- ``funced`` will now always ``source`` the file after it has written it, even if the contents did not change. This prevents issues if the file was otherwise modified (:issue:`10318`). +- The warning for when a builtin returns a negative exit code was improved, now mentioning the original status (:issue:`10187`). +- Added completions for + + - ``cobra-cli`` (:issue:`10293`) + - ``dmidecode`` (:issue:`10368`) + - ``mycli`` (:issue:`10309`) + - ``ollama`` (:issue:`10327`) + - ``pstree`` (:issue:`10317`) + +- Some improvements to documentation and completions. + +-------------- + fish 3.7.0 (released January 1, 2024) ===================================== diff --git a/doc_src/cmds/argparse.rst b/doc_src/cmds/argparse.rst index e3dd66400..659af0936 100644 --- a/doc_src/cmds/argparse.rst +++ b/doc_src/cmds/argparse.rst @@ -32,6 +32,7 @@ The following ``argparse`` options are available. They must appear before all *O **-x** or **--exclusive** *OPTIONS* A comma separated list of options that are mutually exclusive. You can use this more than once to define multiple sets of mutually exclusive options. + You give either the short or long version of each option, and you still need to otherwise define the options. **-N** or **--min-args** *NUMBER* The minimum number of acceptable non-option arguments. The default is zero. @@ -205,6 +206,37 @@ After parsing the arguments the ``argv`` variable is set with local scope to any If an error occurs during argparse processing it will exit with a non-zero status and print error messages to stderr. +Examples +--------- + +A simple use:: + + argparse h/help -- $argv + or return + + if set -q _flag_help + # TODO: Print help here + return 0 + end + +This just wants one option - ``-h`` / ``--help``. Any other option is an error. If it is given it prints help and exits. + +How :doc:`fish_add_path` parses its args:: + + argparse -x g,U -x P,U -x a,p g/global U/universal P/path p/prepend a/append h/help m/move v/verbose n/dry-run -- $argv + +There are a variety of boolean flags, all with long and short versions. A few of these cannot be used together, and that is what the ``-x`` flag is used for. +``-x g,U`` means that ``--global`` and ``--universal`` or their short equivalents conflict, and if they are used together you get an error. +In this case you only need to give the short or long flag, not the full option specification. + +After this it figures out which variable it should operate on according to the ``--path`` flag:: + + set -l var fish_user_paths + set -q _flag_path + and set var PATH + + + Limitations ----------- diff --git a/doc_src/completions.rst b/doc_src/completions.rst index 3a9ddb36f..0017a4cb3 100644 --- a/doc_src/completions.rst +++ b/doc_src/completions.rst @@ -11,48 +11,6 @@ To provide a list of possible completions for myprog, use the ``-a`` switch. If complete -c myprog -s o -l output -a "yes no" - -In the complete call above, the ``-a`` arguments apply when the option -o/--output has been given, so this offers them for:: - - > myprog -o - > myprog --output= - -By default, option arguments are *optional*, so the candidates are only offered directly attached like that, so they aren't given in this case:: - - > myprog -o - -Usually options *require* a parameter, so you would give ``--require-parameter`` / ``-r``:: - - complete -c myprog -s o -l output -ra "yes no" - -which offers yes/no in these cases:: - - > myprog -o - > myprog --output= - > myprog -o - > myprog --output - -In the latter two cases, files will also be offered because file completion is enabled by default. - -You would either inhibit file completion for a single option:: - - complete -c myprog -s o -l output --no-files -ra "yes no" - -or with a specific condition:: - - complete -c myprog -f --condition '__fish_seen_subcommand_from somesubcommand' - -or you can disable file completions globally for the command:: - - complete -c myprog -f - -If you have disabled them globally, you can enable them just for a specific condition or option with the ``--force-files`` / ``-F`` option:: - - # Disable files by default - complete -c myprog -f - # but reenable them for --config-file - complete -c myprog -l config-file --force-files -r - In the complete call above, the ``-a`` arguments apply when the option -o/--output has been given, so this offers them for:: > myprog -o diff --git a/share/completions/apt-get.fish b/share/completions/apt-get.fish index 790e7a1c6..1889504d0 100644 --- a/share/completions/apt-get.fish +++ b/share/completions/apt-get.fish @@ -36,6 +36,7 @@ complete -f -n __fish_apt_no_subcommand -c apt-get -a clean -d 'Clean local cach complete -f -n __fish_apt_no_subcommand -c apt-get -a autoclean -d 'Clean packages no longer be downloaded' complete -f -n __fish_apt_no_subcommand -c apt-get -a autoremove -d 'Remove automatically installed packages' complete -c apt-get -l no-install-recommends -d 'Do not install recommended packages' +complete -c apt-get -l no-install-suggests -d 'Do not install suggested packages' complete -c apt-get -s d -l download-only -d 'Download Only' complete -c apt-get -s f -l fix-broken -d 'Correct broken dependencies' complete -c apt-get -s m -l fix-missing -d 'Ignore missing packages' @@ -43,10 +44,12 @@ complete -c apt-get -l no-download -d 'Disable downloading packages' complete -c apt-get -s q -l quiet -d 'Quiet mode' complete -c apt-get -s s -l simulate -l just-print -l dry-run -l recon -l no-act -d 'Perform a simulation' complete -c apt-get -s y -l yes -l assume-yes -d 'Automatic yes to prompts' +complete -c apt-get -l assume-no -d 'Automatic no to prompts' complete -c apt-get -s u -l show-upgraded -d 'Show upgraded packages' complete -c apt-get -s V -l verbose-versions -d 'Show full versions for packages' complete -c apt-get -s b -l compile -l build -d 'Compile source packages' complete -c apt-get -l install-recommends -d 'Install recommended packages' +complete -c apt-get -l install-suggests -d 'Install suggested packages' complete -c apt-get -l ignore-hold -d 'Ignore package Holds' complete -c apt-get -l no-upgrade -d "Do not upgrade packages" complete -c apt-get -l force-yes -d 'Force yes' diff --git a/share/completions/apt.fish b/share/completions/apt.fish index 9a3443e8a..8ce4ace63 100644 --- a/share/completions/apt.fish +++ b/share/completions/apt.fish @@ -37,7 +37,18 @@ complete -k -c apt -n "__fish_seen_subcommand_from $pkg_subcmds" -a '(__fish_pri complete -c apt -n "__fish_seen_subcommand_from $installed_pkg_subcmds" -a '(__fish_print_apt_packages --installed | string match -re -- "(?:\\b|_)"(commandline -ct | string escape --style=regex) | head -n 250)' complete -k -c apt -n "__fish_seen_subcommand_from $handle_file_pkg_subcmds" -a '(__fish_complete_suffix .deb)' -complete -c apt -n "__fish_seen_subcommand_from install" -l no-install-recommends +complete -c apt -n "__fish_seen_subcommand_from install" -l no-install-recommends -d 'Do not install recommended packages' +complete -c apt -n "__fish_seen_subcommand_from install" -l no-install-suggests -d 'Do not install suggested packages' +complete -c apt -n "__fish_seen_subcommand_from install" -s d -l download-only -d 'Download Only' +complete -c apt -n "__fish_seen_subcommand_from install" -s f -l fix-broken -d 'Correct broken dependencies' +complete -c apt -n "__fish_seen_subcommand_from install" -s m -l fix-missing -d 'Ignore missing packages' +complete -c apt -n "__fish_seen_subcommand_from install" -l no-download -d 'Disable downloading packages' +complete -c apt -n "__fish_seen_subcommand_from install" -s q -l quiet -d 'Quiet mode' +complete -c apt -n "__fish_seen_subcommand_from install" -s s -l simulate -l just-print -l dry-run -l recon -l no-act -d 'Perform a simulation' +complete -c apt -n "__fish_seen_subcommand_from install" -s y -l yes -l assume-yes -d 'Automatic yes to prompts' +complete -c apt -n "__fish_seen_subcommand_from install" -l assume-no -d 'Automatic no to prompts' +complete -c apt -n "__fish_seen_subcommand_from install" -l install-recommends -d 'Install recommended packages' +complete -c apt -n "__fish_seen_subcommand_from install" -l install-suggests -d 'Install suggested packages' # This advanced flag is the safest way to upgrade packages that otherwise would have been kept back complete -c apt -n "__fish_seen_subcommand_from upgrade" -l with-new-pkgs diff --git a/share/completions/blender.fish b/share/completions/blender.fish index 41d5c373d..1073bd66c 100644 --- a/share/completions/blender.fish +++ b/share/completions/blender.fish @@ -16,25 +16,25 @@ end function __blender_list_scenes blender --background (__blender_echo_input_file_name) --python-expr 'import bpy for scene in bpy.data.scenes: - print(f"\t{scene.name}")' | + print(f"\t{scene.name}")' 2>/dev/null | string replace -r -f '^\t' '' end function __blender_list_texts blender --background (__blender_echo_input_file_name) --python-expr 'import bpy for text in bpy.data.texts: - print(f"\t{text.name}")' | + print(f"\t{text.name}")' 2>/dev/null | string replace -r -f '^\t' '' end function __blender_list_engines - blender --background --engine help | string replace -r -f '^\t' '' + blender --background --engine help 2>/dev/null | string replace -r -f '^\t' '' end function __blender_list_addons blender --background --python-expr 'import addon_utils for mod in addon_utils.modules(): - print(f"\t{mod.__name__}")' | + print(f"\t{mod.__name__}")' 2>/dev/null | string replace -r -f '^\t' '' end diff --git a/share/completions/cobra-cli.fish b/share/completions/cobra-cli.fish new file mode 100644 index 000000000..949779388 --- /dev/null +++ b/share/completions/cobra-cli.fish @@ -0,0 +1 @@ +cobra-cli completion fish | source diff --git a/share/completions/curl.fish b/share/completions/curl.fish index 750bf555b..2b3bea883 100644 --- a/share/completions/curl.fish +++ b/share/completions/curl.fish @@ -231,3 +231,4 @@ complete -c curl -l eprt -l no-eprt -d 'for --disable-eprt' complete -c curl -l epsv -l no-epsv -d 'for --disable-epsv' complete -c curl -l max-redir -d 'Set maximum number of redirects' complete -c curl -l xattr -d 'Store metadata in xattrs (like origin URL)' +complete -c curl -l url-query -d '(HTTP) Add a URL query part' diff --git a/share/completions/dmidecode.fish b/share/completions/dmidecode.fish new file mode 100644 index 000000000..31e47ab4a --- /dev/null +++ b/share/completions/dmidecode.fish @@ -0,0 +1,22 @@ +function __fish_dmidecode_complete_keywords + dmidecode -s 2>&1 1>/dev/null | string match -rg '^\s+(.*)' +end + +function __fish_dmidecode_complete_types + dmidecode -t 2>&1 1>/dev/null | string match -rg '^\s+(.*)' +end + +complete -c dmidecode -f +complete -c dmidecode -s d -l dev-mem -r -d 'Memory device file' +complete -c dmidecode -s q -l quiet -d 'Be less verbose' +complete -c dmidecode -l no-quirks -d 'Decode everything exactly as it is' +complete -c dmidecode -s s -l string -xa '(__fish_dmidecode_complete_keywords)' -d 'Only display specified value' +complete -c dmidecode -s t -l type -xa '(__fish_dmidecode_complete_types)' -d 'Only display entries of specified type' +complete -c dmidecode -s H -l handle -x -d 'Only display specified handle' +complete -c dmidecode -s u -l dump -d 'Do not decode the entries' +complete -c dmidecode -l dump-bin -r -d 'Dump DMI data to a file' +complete -c dmidecode -l from-dump -r -d 'Read DMI data generated using --dump-bin' +complete -c dmidecode -l no-sysfs -d 'Do not attempt to read DMI data from sysfs files' +complete -c dmidecode -l oem-string -x -d 'Only display the value of the OEM string number N' +complete -c dmidecode -s h -l help -d 'Display usage information and exit' +complete -c dmidecode -s V -l version -d 'Display the version and exit' diff --git a/share/completions/echo.fish b/share/completions/echo.fish index 0ad08995a..610bfad14 100644 --- a/share/completions/echo.fish +++ b/share/completions/echo.fish @@ -2,4 +2,3 @@ complete -c echo -s n -d "Do not output a newline" complete -c echo -s s -d "Do not separate arguments with spaces" complete -c echo -s E -d "Disable backslash escapes" complete -c echo -s e -d "Enable backslash escapes" -complete -c echo -s h -l help -d "Display help and exit" diff --git a/share/completions/fastboot.fish b/share/completions/fastboot.fish index 3c6c01039..05862b093 100644 --- a/share/completions/fastboot.fish +++ b/share/completions/fastboot.fish @@ -1,15 +1,19 @@ set -l commands flashall getvar oem flashing reboot update erase format devices flash get_staged help stage boot fetch function __fish_fastboot_list_partition_or_file - if __fish_seen_subcommand_from (__fish_fastboot_list_partition){_a,_b,} - __fish_complete_path - else - __fish_fastboot_list_partition + set -l tokens (commandline -opc) + # if last 2 token is flash, then list file + if test (count $tokens) -gt 2 + if test $tokens[-2] = flash + __fish_complete_path + return + end end + __fish_fastboot_list_partition end function __fish_fastboot_list_partition - set -l partitions boot bootloader dtbo modem odm odm_dlkm oem product pvmfw radio recovery system vbmeta vendor vendor_dlkm cache userdata system_ext + set -l partitions boot bootloader cache cust dtbo metadata misc modem odm odm_dlkm oem product pvmfw radio recovery system system_ext userdata vbmeta vendor vendor_dlkm vmbeta_system for i in $partitions echo $i end @@ -20,7 +24,7 @@ complete -c fastboot -s v -l verbose -d 'Verbose output' complete -c fastboot -l version -d 'Display version' complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -s w -d 'Wipe userdata' -complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -s s -d 'Specify a device' +complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -s s -x -a "(fastboot devices)" -d 'Specify a device' complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -s S -d 'Break into sparse files no larger than SIZE' complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -l slot -d 'Use SLOT; \'all\' for both slots, \'other\' for non-current slot (default: current active slot)' -xa "all other a b" complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -l set-active -d 'Sets the active slot before rebooting' -xa "a b" @@ -73,4 +77,3 @@ complete -n '__fish_seen_subcommand_from reboot' -c fastboot -xa 'bootloader fas # oem complete -n '__fish_seen_subcommand_from oem' -c fastboot -xa 'device-info lock unlock edl' - diff --git a/share/completions/highlight.fish b/share/completions/highlight.fish deleted file mode 100644 index ef82025ad..000000000 --- a/share/completions/highlight.fish +++ /dev/null @@ -1,8 +0,0 @@ - -complete -c highlight -s O -l out-format -d 'Output file in given format' -xa 'xterm256 latex tex rtf html xhtml ansi bbcode svg' -complete -c highlight -s t -l tab -d 'Specify tab length' -x -complete -c highlight -s i -l input -d 'Name of the input file' -r -complete -c highlight -s o -l output -d 'Name of the output file' -r -complete -c highlight -s d -l outdir -d 'Output directory' -r -complete -c highlight -s S -l syntax -d 'Set type of the source code' -xa "(highlight -p | sed -r 's/^(.*[^[:space:]])[[:space:]]+:[[:space:]]*([^[:space:]]+).*\$/\2\t\1/; /^\$/d')" -complete -c highlight -s s -l style -d 'Highlight style' -xa "(highlight --list-themes | sed '/^\$\| /d')" diff --git a/share/completions/htop.fish b/share/completions/htop.fish index b8cdace88..89c343373 100644 --- a/share/completions/htop.fish +++ b/share/completions/htop.fish @@ -1,11 +1,22 @@ # htop is an interactive process viewer. -# See: http://hisham.hm/htop +# See: https://htop.dev complete -c htop -l delay -s d -d 'Update interval' -x complete -c htop -l no-color -s C -d 'Start htop in monochrome mode' complete -c htop -l no-colour -d 'Start htop in monochrome mode' +complete -c htop -l filter -s F -d 'Filter processes by terms matching the commands' -x complete -c htop -l help -s h -d 'Show help and exit' -complete -c htop -l pid -s p -d 'Show only given PIDs' -x -a '(__fish_append , (__fish_complete_pids))' -complete -c htop -l user -s u -d 'Monitor given user' -x -a '(__fish_complete_users)' -complete -c htop -l sort-key -d 'Sort column' -xa '(htop --sort-key help)' -complete -c htop -l version -s v -d 'Show version and exit' +complete -c htop -l pid -s p -d 'Show only given PIDs' -xa '(__fish_append , (__fish_complete_pids))' +complete -c htop -l sort-key -s s -d 'Sort column' -xa '(htop --sort-key help)' +complete -c htop -l user -s u -d 'Monitor given user' -xa '(__fish_complete_users)' +complete -c htop -l no-unicode -s U -d 'Do not use unicode but ASCII characters for graph meters' +complete -c htop -l no-mouse -s M -d 'Disable support of mouse control' +complete -c htop -l readonly -d 'Disable all system and process changing features' +complete -c htop -l version -s V -d 'Show version and exit' +complete -c htop -l tree -s t -d 'Show processes in tree view' +complete -c htop -l highlight-changes -s H -d 'Highlight new and old processes' -x +complete -c htop -l drop-capabilites -d 'Drop unneeded Linux capabilites (Requires libpcap support)' -xka " + off + basic + strict + " diff --git a/share/completions/iwctl.fish b/share/completions/iwctl.fish index 5384d686c..35e9e4d51 100644 --- a/share/completions/iwctl.fish +++ b/share/completions/iwctl.fish @@ -14,7 +14,7 @@ function __iwctl_filter -w iwctl set -l results (iwctl $argv | string replace -ra '\e\[[\d;]+m' '') # calculate column widths set -l headers $results[3] - # We exploit the fact that all colum labels will have >2 space to the left, and inside column labels there is always only one space. + # We exploit the fact that all column labels will have >2 space to the left, and inside column labels there is always only one space. set -l leading_ws (string match -r "^ *" -- $headers | string length) set -l column_widths (string match -a -r '(?<= )\S.*?(?: (?=\S)|$)' -- $headers | string length) diff --git a/share/completions/mycli.fish b/share/completions/mycli.fish new file mode 100644 index 000000000..21ff2292d --- /dev/null +++ b/share/completions/mycli.fish @@ -0,0 +1,8 @@ +# fish completion for mycli -*- shell-script -*- + +function __fish_mycli_dsn + mycli --list-dsn +end + +complete -c mycli -s d -l dsn -x -d 'Use DSN configured into the [alias_dsn]' -a '(__fish_mycli_dsn)' +complete -c mycli -a '(__fish_mycli_dsn)' diff --git a/share/completions/ollama.fish b/share/completions/ollama.fish new file mode 100644 index 000000000..3e3c03ce8 --- /dev/null +++ b/share/completions/ollama.fish @@ -0,0 +1,20 @@ +function __fish_ollama_list + ollama list 2>/dev/null | tail -n +2 | string replace --regex "\s.*" "" +end + +complete -c ollama -a serve -d "Start ollama" +complete -c ollama -a create -d "Create a model from a Modelfile" +complete -c ollama -a show -d "Show information for a model" +complete -c ollama -a run -d "Run a model" +complete -c ollama -a pull -d "Pull a model from a registry" +complete -c ollama -a push -d "Push a model to a registry" +complete -c ollama -a list -d "List models" +complete -c ollama -a cp -d "Copy a model" +complete -c ollama -a rm -d "Remove a model" +complete -c ollama -a help -d "Help about any command" +complete -c ollama -s h -l help -d "help for ollama" +complete -c ollama -s v -l version -d "Show version information" +complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from show' +complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from run' +complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from cp' +complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from rm' diff --git a/share/completions/pstree.fish b/share/completions/pstree.fish new file mode 100644 index 000000000..510ab96e2 --- /dev/null +++ b/share/completions/pstree.fish @@ -0,0 +1,22 @@ +complete -c pstree -f +complete -c pstree -s a -l arguments -d 'Show command line arguments' +complete -c pstree -s A -l ascii -d 'use ASCII line drawing characters' +complete -c pstree -s c -l compact -d 'don\'t compact identical subtrees' +complete -c pstree -s h -l highlight-all -d 'highlight current process and its ancestors' +complete -c pstree -s H -l highlight-pid -d 'highlight this process and its ancestors' -a '(__fish_complete_pids)' +complete -c pstree -s g -l show-pgids -d 'show process group ids; implies -c' +complete -c pstree -s G -l vt100 -d 'use VT100 line drawing characters' +complete -c pstree -s l -l long -d 'don\'t truncate long lines' +complete -c pstree -s n -l numeric-sort -d 'sort output by PID' +complete -c pstree -s N -l ns-sort -d 'sort by namespace type' -xa 'cgroup ipc mnt net pid user uts' +complete -c pstree -s p -l show-pids -d 'show PIDs; implies -c' +complete -c pstree -s s -l show-parents -d 'show parents of the selected process' +complete -c pstree -s S -l ns-changes -d 'show namespace transitions' +complete -c pstree -s t -l thread-names -d 'show full thread names' +complete -c pstree -s T -l hide-threads -d 'hide threads, show only processes' +complete -c pstree -s u -l uid-changes -d 'show uid transitions' +complete -c pstree -s U -l unicode -d 'use UTF-8 line drawing characters' +complete -c pstree -s V -l version -d 'display version information' +complete -c pstree -s Z -l security-context -d 'show SELinux security contexts' +complete -c pstree -a '(__fish_complete_pids)' -d PID +complete -c pstree -a '(__fish_complete_users)' -d USER diff --git a/share/completions/ssh.fish b/share/completions/ssh.fish index 0e1083610..9caa53f28 100644 --- a/share/completions/ssh.fish +++ b/share/completions/ssh.fish @@ -13,6 +13,7 @@ complete -c ssh -n 'test (__fish_number_of_cmd_args_wo_opts) -ge 2' -d "Command complete -c ssh -s a -d "Disables forwarding of the authentication agent" complete -c ssh -s B -d "Bind to the address of that interface" -xa '(__fish_print_interfaces)' complete -c ssh -s b -d "Local address to bind to" -xa '(__fish_print_addresses)' +complete -c ssh -s D -d "Specify dynamic port forwarding" -x complete -c ssh -s E -d "Append debug logs to log_file" -rF complete -c ssh -s e -d "Escape character" -xa "\^ none" complete -c ssh -s f -d "Go to background" diff --git a/share/completions/strace.fish b/share/completions/strace.fish index 4fae1c203..abb7a8cde 100644 --- a/share/completions/strace.fish +++ b/share/completions/strace.fish @@ -1,24 +1,74 @@ # Startup +complete -c strace -s E -l env -d 'Remove var from the inherited list of environment variables before passing it on to the command' complete -c strace -s p -l attach -xa '(__fish_complete_pids)' complete -c strace -s u -l user -xa '(__fish_complete_users)' +complete -c strace -l argv0 -d 'Set argv[0] of the command being executed to name' # Tracing complete -c strace -s b -l detach-on -d 'Detach when the specified syscall is reached' +complete -c strace -s D -l daemonize -d 'Run tracer process as a grandchild, not as the parent of the tracee' +complete -c strace -o DD -d "Run tracer process as tracee's grandchild in a separate process group." +complete -c strace -o DDD -d "Run tracer process as tracee's grandchild in a separate session" +complete -c strace -s f -l follow-forks +complete -c strace -l output-separately +complete -c strace -o ff -d 'Like --follow-forks --output-separately' +complete -c strace -s I -l interruptible -d 'When strace can be interrupted by signals' +complete -c strace -l syscall-limit -d 'Detach all tracees when LIMIT number of syscalls have been captured' +complete -c strace -l kill-on-exit -d 'Set PTRACE_O_EXITKILL ptrace option to all tracee processes' # General/Filtering/Tampering -complete -c strace -s e -d 'Set expression which modifies which events to trace' +complete -c strace -s e -l trace -d 'Set expression which modifies which events to trace' +complete -c strace -s e -l trace-fds -d 'Set expression which modifies which events to trace' +complete -c strace -s e -l signal -d 'Set expression which modifies which events to trace' +complete -c strace -s e -l status -d 'Set expression which modifies which events to trace' +complete -c strace -s P -l trace-path -d 'Trace only system calls accessing path' +complete -c strace -s z -l successful-only -d 'Print only syscalls that returned without an error code' +complete -c strace -s Z -l failed-only -d 'Print only syscalls that returned with an error code' # Output format complete -c strace -s a -l columns -d 'Align output in columns' +complete -c strace -s e -l verbose -d 'Dereference structures for the specified set of system calls' +complete -c strace -l decode-pids -d 'Decode various information associated with process IDs' +complete -c strace -l silence -l silent -l quiet -d 'Suppress various information messages' +complete -c strace -l decode-fds -d 'Decode various information associated with file descriptors' +complete -c strace -l decode-pids -d 'Decode various information associated with process IDs' +complete -c strace -l kvm -d 'Print the exit reason of kvm vcpu' +complete -c strace -s i -l instruction-pointer -d 'Print the instruction pointer at the time of the system call' +complete -c strace -s n -l syscall-number -d 'Print the syscall number' +complete -c strace -s k -l stack-traces -d 'Print the execution stack trace of the traced processes after each system call' +complete -c strace -s o -l output -d 'Write the trace output to the file filename rather than to stderr' +complete -c strace -s A -l output-append-mode -d 'Open the file provided in the -o option in append mode' +complete -c strace -s q -l quiet +complete -c strace -o qq -l quiet +complete -c strace -o qqq -l quiet +complete -c strace -s r -l relative-timestamps -d 'Print a relative timestamp upon entry to each system call' +complete -c strace -s s -l string-limit -d 'Specify the maximum string size to print (the default is 32)' +complete -c strace -l absolute-timestamps -l timestamps -d 'Prefix each line of the trace with the wall clock time' +complete -c strace -s t -l absolute-timestamps -d 'Prefix each line of the trace with the wall clock time' +complete -c strace -o tt -l absolute-timestamps -d 'If given twice, the time printed will include the microseconds' +complete -c strace -o ttt -l absolute-timestamps +complete -c strace -s T -l syscall-times -d 'Show the time spent in system calls' +complete -c strace -s v -l no-abbrev -d 'Print unabbreviated versions of environment' +complete -c strace -l strings-in-hex -d 'Control usage of escape sequences with hexadecimal numbers in the printed strings' complete -c strace -s x -d 'Print all non-ASCII strings in hex format' -complete -c strace -s xx -d 'Print all strings in hex format' +complete -c strace -o xx -d 'Print all strings in hex format' +complete -c strace -s X -l const-print-style -d 'Set the format for printing of named constants and flags' +complete -c strace -o yy -l decode-fds -d 'Print all available information associated with file descriptors' +complete -c strace -s y -l decode-fds -d 'Print paths associated with file descriptor arguments and with the AT_FDCWD constant' +complete -c strace -l pidns-translation -l decode-pids -d "print PIDs in strace's namespace" +complete -c strace -s Y -l decode-pids -d 'Print command names for PIDs' # Statistics complete -c strace -s c -l summary-only -d 'Suppress output and report summary on exit' complete -c strace -s C -l summary -d 'Display output and report summary on exit' +complete -c strace -s O -l summary-syscall-overhead -d 'Set the overhead for tracing system calls to overhead' complete -c strace -s S -l summary-sort-by -xa 'time time_total total_time calls count errors error name syscall syscall_name nothing none' -d 'Sort summary by the specified criterion' +complete -c strace -s U -l summary-columns -d 'Configure a set (and order) of columns being shown in the call summary' +complete -c strace -s w -l summary-wall-clock -d 'Summarise the time difference between the beginning and end of each system call' # Miscellaneous complete -c strace -s d -l debug -d 'Debug output' +complete -c strace -l seccomp-bpf -d 'Try to enable use of seccomp-bpf' +complete -c strace -l tips -d 'Show strace tips, tricks, and tweaks before exit' complete -c strace -s h -l help -d 'Print help and exit' complete -c strace -s V -l version -d 'Print version and exit' diff --git a/share/completions/wg-quick.fish b/share/completions/wg-quick.fish index aaf77bcc4..9ca1af38e 100644 --- a/share/completions/wg-quick.fish +++ b/share/completions/wg-quick.fish @@ -1,7 +1,7 @@ set -l valid_subcmds up down strip save function __fish_wg_complete_interfaces - wg show interfaces + wg show interfaces | string split " " end complete -c wg-quick -f diff --git a/share/completions/xbps-query.fish b/share/completions/xbps-query.fish index 4757035b5..ef614e68d 100644 --- a/share/completions/xbps-query.fish +++ b/share/completions/xbps-query.fish @@ -68,5 +68,6 @@ complete -c $progname -s S -d 'Shows information of an installed package' -x complete -c $progname -s s -d 'Search for packages by matching PATTERN on pkgver or short_desc' complete -c $progname -s f -d 'Show the package files for PKG' -x complete -c $progname -s x -d 'Show the required dependencies for PKG. Only direct dependencies are shown' -x -complete -c $progname -s X -d 'Show the reverse dependencies for PKG' -x +complete -c $progname -s X -d 'Show the reverse dependencies for PKG' -xa "$listinstalled" +complete -c $progname -s X -d 'Show the reverse dependencies for PKG' -x -n "__fish_contains_opt -s R" -a "$listall" complete -c $progname -l cat -d 'Prints the file FILE stored in binary package PKG to stdout' -F diff --git a/share/functions/__fish_anypager.fish b/share/functions/__fish_anypager.fish index 3546ca984..83333d5e1 100644 --- a/share/functions/__fish_anypager.fish +++ b/share/functions/__fish_anypager.fish @@ -17,7 +17,7 @@ function __fish_anypager --description "Print a pager to use" end # Cheesy hardcoded list of pagers. - for cmd in bat lv most less more + for cmd in less bat lv most more if command -q $cmd echo -- $cmd return 0 diff --git a/share/functions/__fish_complete_gpg.fish b/share/functions/__fish_complete_gpg.fish index 76dc15521..0e014fb19 100644 --- a/share/functions/__fish_complete_gpg.fish +++ b/share/functions/__fish_complete_gpg.fish @@ -264,9 +264,6 @@ function __fish_complete_gpg -d "Internal function for gpg completion code dedup complete -c $__fish_complete_gpg_command -l for-your-eyes-only -d "Set the 'for your eyes only' flag in the message" complete -c $__fish_complete_gpg_command -l no-for-your-eyes-only -d "Clear the 'for your eyes only' flag in the message" - complete -c $__fish_complete_gpg_command -l use-embedded-filename -d "Create file with name as given in data" - complete -c $__fish_complete_gpg_command -l no-use-embedded-filename -d "Don't create file with name as given in data" - complete -c $__fish_complete_gpg_command -l completes-needed -x -d "Number of completely trusted users to introduce a new key signer (defaults to 1)" complete -c $__fish_complete_gpg_command -l marginals-needed -x -d "Number of marginally trusted users to introduce a new key signer (defaults to 3)" diff --git a/share/functions/funced.fish b/share/functions/funced.fish index 1cba34efa..3724b4eb5 100644 --- a/share/functions/funced.fish +++ b/share/functions/funced.fish @@ -114,7 +114,9 @@ function funced --description 'Edit function definition' set -l new_checksum (__funced_md5 "$tmpname") if test "$new_checksum" = "$checksum" echo (_ "Editor exited but the function was not modified") - # Don't source or save an unmodified file. + # Source but don't save an unmodified file. + # (Source in case the file changed externally since we first loaded it.) + source "$writepath" break end end diff --git a/share/functions/history.fish b/share/functions/history.fish index 09b078fff..2bb9fdd4a 100644 --- a/share/functions/history.fish +++ b/share/functions/history.fish @@ -174,7 +174,7 @@ function history --description "display or manipulate interactive command histor end if string match -qr '^[1-9][0-9]*$' -- $i - and test $i -lt $found_items_count + and test $i -le $found_items_count set -a choices $i else printf (_ "Ignoring invalid history entry ID \"%s\"\n") $i diff --git a/share/functions/prompt_hostname.fish b/share/functions/prompt_hostname.fish index dcb733578..01e510785 100644 --- a/share/functions/prompt_hostname.fish +++ b/share/functions/prompt_hostname.fish @@ -1,3 +1,3 @@ function prompt_hostname --description 'short hostname for the prompt' - string replace -r "\..*" "" $hostname + string replace -r -- "\..*" "" $hostname end diff --git a/src/builtins/abbr.cpp b/src/builtins/abbr.cpp index 7e202712e..94658d750 100644 --- a/src/builtins/abbr.cpp +++ b/src/builtins/abbr.cpp @@ -262,7 +262,7 @@ static int abbr_add(const abbr_options_t &opts, io_streams_t &streams) { abbrs_position_t position = opts.position ? *opts.position : abbrs_position_t::command; // Note historically we have allowed overwriting existing abbreviations. - abbreviation_t abbr{std::move(name), std::move(key), std::move(replacement), position}; + abbreviation_t abbr{name, std::move(key), std::move(replacement), position}; abbr.regex = std::move(regex); abbr.replacement_is_function = opts.function.has_value(); abbr.set_cursor_marker = opts.set_cursor_marker; diff --git a/src/builtins/set.cpp b/src/builtins/set.cpp index 4257c90a5..bd47b177d 100644 --- a/src/builtins/set.cpp +++ b/src/builtins/set.cpp @@ -190,6 +190,7 @@ static int parse_cmd_opts(set_cmd_opts_t &opts, int *optind, //!OCLINT(high ncs static int validate_cmd_opts(const wchar_t *cmd, const set_cmd_opts_t &opts, int argc, const wchar_t *argv[], parser_t &parser, io_streams_t &streams) { + UNUSED(argv); // Can't query and erase or list. if (opts.query && (opts.erase || opts.list)) { streams.err.append_format(BUILTIN_ERR_COMBO, cmd);