From 7659554deafd7a6f8c710fc42b52328be4561c05 Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Sun, 1 Apr 2018 13:42:38 -0700 Subject: [PATCH] Remove use of caret redirection from share/* This removes the use of caret redirections from share/completions and share/functions, in preparation for dropping support in fish. --- share/completions/ack.fish | 2 +- share/completions/adb.fish | 2 +- share/completions/apm.fish | 2 +- share/completions/apropos.fish | 2 +- share/completions/busctl.fish | 2 +- share/completions/cat.fish | 2 +- share/completions/chsh.fish | 2 +- share/completions/cower.fish | 2 +- share/completions/cp.fish | 2 +- share/completions/date.fish | 2 +- share/completions/dconf.fish | 2 +- share/completions/df.fish | 2 +- share/completions/duply.fish | 2 +- share/completions/eselect.fish | 4 +- share/completions/fossil.fish | 2 +- share/completions/git.fish | 22 +++++----- share/completions/gradle.fish | 2 +- share/completions/grunt.fish | 2 +- share/completions/gsettings.fish | 10 ++--- share/completions/head.fish | 2 +- share/completions/helm.fish | 6 +-- share/completions/hg.fish | 2 +- share/completions/iptables.fish | 2 +- share/completions/journalctl.fish | 4 +- share/completions/kill.fish | 2 +- share/completions/killall.fish | 2 +- share/completions/ls.fish | 2 +- share/completions/lua.fish | 2 +- share/completions/mkdir.fish | 4 +- share/completions/mktemp.fish | 2 +- share/completions/modinfo.fish | 2 +- share/completions/npm.fish | 2 +- share/completions/pactl.fish | 4 +- share/completions/passwd.fish | 2 +- share/completions/perl.fish | 2 +- share/completions/psql.fish | 4 +- share/completions/rm.fish | 2 +- share/completions/rsync.fish | 2 +- share/completions/sed.fish | 2 +- share/completions/seq.fish | 2 +- share/completions/ssh.fish | 2 +- share/completions/stat.fish | 2 +- share/completions/sysctl.fish | 6 +-- share/completions/tail.fish | 2 +- share/completions/tmux.fish | 10 ++--- share/completions/touch.fish | 2 +- share/completions/tr.fish | 2 +- share/completions/uniq.fish | 2 +- share/completions/valgrind.fish | 2 +- share/completions/vi.fish | 2 +- share/completions/which.fish | 2 +- .../functions/__fish_complete_lpr_option.fish | 4 +- share/functions/__fish_complete_man.fish | 2 +- .../__fish_complete_subcommand_root.fish | 2 +- .../__fish_complete_zfs_rw_properties.fish | 2 +- .../functions/__fish_config_interactive.fish | 18 ++++---- share/functions/__fish_describe_command.fish | 2 +- share/functions/__fish_git_prompt.fish | 42 +++++++++---------- share/functions/__fish_hg_prompt.fish | 4 +- share/functions/__fish_is_git_repository.fish | 2 +- .../__fish_make_completion_signals.fish | 4 +- share/functions/__fish_man_page.fish | 6 +-- share/functions/__fish_paginate.fish | 2 +- ...sh_portage_print_available_categories.fish | 2 +- share/functions/__fish_print_help.fish | 4 +- share/functions/__fish_print_lpr_options.fish | 2 +- .../functions/__fish_print_lpr_printers.fish | 2 +- .../functions/__fish_print_make_targets.fish | 6 +-- share/functions/__fish_print_modules.fish | 2 +- share/functions/__fish_print_packages.fish | 2 +- .../functions/__fish_print_service_names.fish | 2 +- .../functions/__fish_print_xdg_mimetypes.fish | 2 +- share/functions/__fish_svn_prompt.fish | 2 +- .../functions/__fish_systemctl_services.fish | 8 ++-- share/functions/__terlar_git_prompt.fish | 4 +- share/functions/_fish_systemctl.fish | 2 +- share/functions/fish_vi_cursor.fish | 6 +-- share/functions/fish_vi_key_bindings.fish | 2 +- share/functions/ls.fish | 4 +- share/functions/nextd.fish | 2 +- share/functions/prevd.fish | 2 +- share/functions/psub.fish | 2 +- 82 files changed, 152 insertions(+), 152 deletions(-) diff --git a/share/completions/ack.fish b/share/completions/ack.fish index 3c37be116..60db3d4c8 100644 --- a/share/completions/ack.fish +++ b/share/completions/ack.fish @@ -84,7 +84,7 @@ complete -c ack -l bar -d 'The warning admiral' # File types if type ack > /dev/null - for type in (ack --dump ^/dev/null | perl -lne 'print $1 if /^\s+--type-add=([^:]+)/' | uniq) + for type in (ack --dump 2>/dev/null | perl -lne 'print $1 if /^\s+--type-add=([^:]+)/' | uniq) complete -c ack -l $type -d "Allow $type file type" complete -c ack -l no$type -l no-$type -d "Don't allow $type file type" end diff --git a/share/completions/adb.fish b/share/completions/adb.fish index 2bdc4f350..f936100cf 100644 --- a/share/completions/adb.fish +++ b/share/completions/adb.fish @@ -49,7 +49,7 @@ function __fish_adb_run_command -d 'Runs adb with any -s parameters already give end function __fish_adb_list_packages - __fish_adb_run_command pm list packages ^/dev/null | string replace 'package:' '' + __fish_adb_run_command pm list packages 2>/dev/null | string replace 'package:' '' end diff --git a/share/completions/apm.fish b/share/completions/apm.fish index ab546493f..15622b417 100644 --- a/share/completions/apm.fish +++ b/share/completions/apm.fish @@ -69,7 +69,7 @@ function __fish_apm_list_packages apm list -b end -if apm -h ^| string match -q "*Atom Package Manager*" +if apm -h 2>| string match -q "*Atom Package Manager*" # Completions for Atom Package Manager ################## diff --git a/share/completions/apropos.fish b/share/completions/apropos.fish index 1b4eb9517..309358255 100644 --- a/share/completions/apropos.fish +++ b/share/completions/apropos.fish @@ -2,7 +2,7 @@ function __fish_complete_apropos if test (commandline -ct) set str (commandline -ct) - apropos $str ^/dev/null |sed -e "s/^\(.*$str\([^ ]*\).*\)\$/$str\2"\t"\1/" + apropos $str 2>/dev/null |sed -e "s/^\(.*$str\([^ ]*\).*\)\$/$str\2"\t"\1/" end end diff --git a/share/completions/busctl.fish b/share/completions/busctl.fish index b103612fa..dd575b15e 100644 --- a/share/completions/busctl.fish +++ b/share/completions/busctl.fish @@ -15,7 +15,7 @@ function __fish_busctl else set mode "--system" end - command busctl $mode $argv --no-legend --no-pager ^/dev/null + command busctl $mode $argv --no-legend --no-pager 2>/dev/null end # Only get the arguments to the actual command, skipping all options and arguments to options diff --git a/share/completions/cat.fish b/share/completions/cat.fish index b3a8e9c72..2a7bce379 100644 --- a/share/completions/cat.fish +++ b/share/completions/cat.fish @@ -1,4 +1,4 @@ -if cat --version ^ /dev/null > /dev/null # GNU +if cat --version 2>/dev/null > /dev/null # GNU complete -c cat -s A -l show-all -d "Escape all non-printing characters" complete -c cat -s b -l number-nonblank -d "Number nonblank lines" complete -c cat -s e -d "Escape non-printing characters except tab" diff --git a/share/completions/chsh.fish b/share/completions/chsh.fish index 3dbbdd7c9..2186ceb9b 100644 --- a/share/completions/chsh.fish +++ b/share/completions/chsh.fish @@ -10,6 +10,6 @@ complete -x -c chsh -a "(__fish_complete_users)" # util-linux's chsh also has a "-l"/"--list-shells" option. # While both FreeBSD and macOS also have "-l", it means something different and probably uninteresting. -if set -l chshversion (chsh --version ^/dev/null); and string match -qr '.*util-linux.*' -- $chshversion +if set -l chshversion (chsh --version 2>/dev/null); and string match -qr '.*util-linux.*' -- $chshversion complete -f -c chsh -s l -l list-shells -d "List available shells and exit" end diff --git a/share/completions/cower.fish b/share/completions/cower.fish index 83918d9cb..9b1c6269d 100644 --- a/share/completions/cower.fish +++ b/share/completions/cower.fish @@ -20,4 +20,4 @@ complete -c cower -f -s v -l 'verbose' -d 'Output more' # Complete with AUR packages: # If the search string is too short, cower prints an annoying message to stderr - ignore that -complete -c cower -f -n 'not string match -q -- "-*" (commandline --current-token)' -a '(cower --format="%n\t%d\n" --search (commandline --current-token) ^/dev/null)' +complete -c cower -f -n 'not string match -q -- "-*" (commandline --current-token)' -a '(cower --format="%n\t%d\n" --search (commandline --current-token) 2>/dev/null)' diff --git a/share/completions/cp.fish b/share/completions/cp.fish index 8bb316d32..178c0408e 100644 --- a/share/completions/cp.fish +++ b/share/completions/cp.fish @@ -1,4 +1,4 @@ -if cp --version ^ /dev/null > /dev/null # GNU +if cp --version 2>/dev/null > /dev/null # GNU complete -c cp -s a -l archive -d "Same as -dpR" complete -c cp -s b -l backup -d "Make backup of each existing destination file" -a "none off numbered t existing nil simple never" complete -c cp -l copy-contents -d "Copy contents of special files when recursive" diff --git a/share/completions/date.fish b/share/completions/date.fish index 62e6af0fa..d033932d8 100644 --- a/share/completions/date.fish +++ b/share/completions/date.fish @@ -1,4 +1,4 @@ -if date --version > /dev/null ^ /dev/null +if date --version > /dev/null 2>/dev/null complete -c date -s d -l date -d "Display date described by string" -x complete -c date -s f -l file -d "Display date for each line in file" -r complete -c date -s I -l iso-8601 -d "Output in ISO 8601 format" -x -a "date hours minutes seconds" diff --git a/share/completions/dconf.fish b/share/completions/dconf.fish index b24866d4e..8c014dd29 100644 --- a/share/completions/dconf.fish +++ b/share/completions/dconf.fish @@ -7,7 +7,7 @@ function __fish_dconf_keys # because it allows us to complete non-incrementally # i.e. to get the keys directly, without going through # `dconf list /`, `dconf list /org/` and so on. - dconf dump / ^/dev/null | while read -l line + dconf dump / 2>/dev/null | while read -l line if string match -q "[*]" -- $line # New directory - just save it for the keys set dir /(string trim -c "[]" -- $line) diff --git a/share/completions/df.fish b/share/completions/df.fish index 19cfdf4b4..5809ae91d 100644 --- a/share/completions/df.fish +++ b/share/completions/df.fish @@ -7,7 +7,7 @@ # set -l is_gnu -df --version >/dev/null ^/dev/null; and set is_gnu --is-gnu +df --version >/dev/null 2>/dev/null; and set is_gnu --is-gnu __fish_gnu_complete -c df -s h -l human-readable -d "Human readable sizes" $is_gnu __fish_gnu_complete -c df -s i -l inodes -d "List inode information" $is_gnu diff --git a/share/completions/duply.fish b/share/completions/duply.fish index eabbe2a89..22eb046fc 100644 --- a/share/completions/duply.fish +++ b/share/completions/duply.fish @@ -1,6 +1,6 @@ # First parameter is the profile name, or 'usage' -complete --command duply --no-files --condition '__fish_is_first_token' --arguments '(/bin/ls /etc/duply ^/dev/null) (/bin/ls ~/.duply ^/dev/null)' -d 'Profile' +complete --command duply --no-files --condition '__fish_is_first_token' --arguments '(/bin/ls /etc/duply 2>/dev/null) (/bin/ls ~/.duply 2>/dev/null)' -d 'Profile' complete --command duply --no-files --arguments 'usage' -d 'Get usage help text' # Second parameter is a duply command diff --git a/share/completions/eselect.fish b/share/completions/eselect.fish index 6ca000f60..d240a25c9 100644 --- a/share/completions/eselect.fish +++ b/share/completions/eselect.fish @@ -19,7 +19,7 @@ function __fish_complete_eselect_action_options # Alter further php completion if [ (__fish_print_cmd_args_without_options)[2] = 'php' ] - eselect php list-modules ^/dev/null | string split " " + eselect php list-modules 2>/dev/null | string split " " return end @@ -38,7 +38,7 @@ function __fish_complete_eselect_php_actions set -l sedregexp 's/^\s*\[([0-9]+)\]\s+([A-Za-z0-9\.]+).*/\1\t\2/' if test (__fish_print_cmd_args_without_options)[3] = 'set' - eselect php list (__fish_print_cmd_args_without_options)[-1] ^/dev/null | sed -r $sedregexp + eselect php list (__fish_print_cmd_args_without_options)[-1] 2>/dev/null | sed -r $sedregexp end end diff --git a/share/completions/fossil.fish b/share/completions/fossil.fish index e21c8e7c7..6b07c7a24 100644 --- a/share/completions/fossil.fish +++ b/share/completions/fossil.fish @@ -2,7 +2,7 @@ # http://www.fossil-scm.org/ function __fish_fossil - command fossil $argv ^/dev/null + command fossil $argv 2>/dev/null end function __fish_fossil_needs_command diff --git a/share/completions/git.fish b/share/completions/git.fish index 9018c03a5..cde489e63 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -6,26 +6,26 @@ function __fish_git_commits # This allows filtering by subject with the new pager! # Because even subject lines can be quite long, # trim them (abbrev'd hash+tab+subject) to 73 characters - command git log --pretty=tformat:"%h"\t"%s" --all --max-count=1000 ^/dev/null | string replace -r '(.{73}).+' '$1…' + command git log --pretty=tformat:"%h"\t"%s" --all --max-count=1000 2>/dev/null | string replace -r '(.{73}).+' '$1…' end function __fish_git_recent_commits # Like __fish_git_commits, but not on all branches and limited to # the last 50 commits. Used for fixup, where only the current branch # and the latest commits make sense. - command git log --pretty=tformat:"%h"\t"%s" --max-count=50 ^/dev/null | string replace -r '(.{73}).+' '$1…' + command git log --pretty=tformat:"%h"\t"%s" --max-count=50 2>/dev/null | string replace -r '(.{73}).+' '$1…' end function __fish_git_branches - command git branch --no-color -a $argv ^/dev/null # Filter out detached heads and such ("(HEAD detached at SOMESHA)", localized). | string match -v '\* (*)' | string match -r -v ' -> ' | string trim -c "* " # We assume anything that's not remote is a local branch. | string replace -r '^(?!remotes/)(.*)' '$1\tLocal Branch' | string replace -r "^remotes/(.*)" '$1\tRemote Branch' + command git branch --no-color -a $argv 2>/dev/null # Filter out detached heads and such ("(HEAD detached at SOMESHA)", localized). | string match -v '\* (*)' | string match -r -v ' -> ' | string trim -c "* " # We assume anything that's not remote is a local branch. | string replace -r '^(?!remotes/)(.*)' '$1\tLocal Branch' | string replace -r "^remotes/(.*)" '$1\tRemote Branch' end function __fish_git_tags - command git tag --sort=-creatordate ^/dev/null + command git tag --sort=-creatordate 2>/dev/null end function __fish_git_dir - command git rev-parse --git-dir ^/dev/null + command git rev-parse --git-dir 2>/dev/null end function __fish_git_heads @@ -44,7 +44,7 @@ function __fish_git_refs end function __fish_git_remotes - command git remote ^/dev/null + command git remote 2>/dev/null end function __fish_git_files @@ -65,7 +65,7 @@ function __fish_git_files # to get _all_ kinds of staged files. # Save the repo root to remove it from the path later. - set -l root (command git rev-parse --show-toplevel ^/dev/null) + set -l root (command git rev-parse --show-toplevel 2>/dev/null) # Cache the translated descriptions so we don't have to get it # once per file. @@ -288,11 +288,11 @@ function __fish_git_stash_not_using_subcommand end function __fish_git_complete_stashes - command git stash list --format=%gd:%gs ^/dev/null | string replace ":" \t + command git stash list --format=%gd:%gs 2>/dev/null | string replace ":" \t end function __fish_git_aliases - command git config -z --get-regexp '^alias\.' ^/dev/null | while read -lz key value + command git config -z --get-regexp '^alias\.' 2>/dev/null | while read -lz key value begin set -l name (string replace -r '^.*\.' '' -- $key) printf "%s\t%s\n" $name "Alias for $value" @@ -345,14 +345,14 @@ function __fish_git_possible_commithash end function __fish_git_reflog - command git reflog --no-decorate ^/dev/null | string replace -r '[0-9a-f]* (.+@\{[0-9]+\}): (.*)$' '$1\t$2' + command git reflog --no-decorate 2>/dev/null | string replace -r '[0-9a-f]* (.+@\{[0-9]+\}): (.*)$' '$1\t$2' end # general options complete -f -c git -l help -d 'Display the manual of a git command' complete -f -c git -n '__fish_git_needs_command' -l version -d 'Display version' complete -x -c git -n '__fish_git_needs_command' -s C -a '(__fish_complete_directories)' -d 'Run as if git was started in this directory' -complete -x -c git -n '__fish_git_needs_command' -s c -a '(command git config -l ^/dev/null | string replace = \t)' -d 'Set a configuration option' +complete -x -c git -n '__fish_git_needs_command' -s c -a '(command git config -l 2>/dev/null | string replace = \t)' -d 'Set a configuration option' complete -x -c git -n '__fish_git_needs_command' -l exec-path -a '(__fish_git_complete_directories)' -d 'Get or set the path to the git programs' complete -f -c git -n '__fish_git_needs_command' -l html-path -d 'Print the path to the html documentation' complete -f -c git -n '__fish_git_needs_command' -l man-path -d 'Print the path to the man documentation' diff --git a/share/completions/gradle.fish b/share/completions/gradle.fish index 7adc60e02..bf5343d1b 100644 --- a/share/completions/gradle.fish +++ b/share/completions/gradle.fish @@ -48,7 +48,7 @@ function __cache_or_get_gradle_completion set -l hashed_pwd (fish_md5 -s $PWD) set -l gradle_cache_file $XDG_CACHE_HOME/gradle-completions/$hashed_pwd if not test -f $gradle_cache_file; or command test build.gradle -nt $gradle_cache_file - command gradle -q tasks ^/dev/null | string match -r '^[[:alnum:]]+ - .*' | string replace ' - ' \t > $gradle_cache_file + command gradle -q tasks 2>/dev/null | string match -r '^[[:alnum:]]+ - .*' | string replace ' - ' \t > $gradle_cache_file end cat $gradle_cache_file end diff --git a/share/completions/grunt.fish b/share/completions/grunt.fish index f02578ea1..828e8841c 100644 --- a/share/completions/grunt.fish +++ b/share/completions/grunt.fish @@ -8,7 +8,7 @@ # https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT function __grunt_print_tasks - set -l tasks (grunt --version --verbose ^/dev/null | awk '/Available tasks: / {$1=$2=""; print $0}' | awk '{$1=$1}1' | tr ' ' '\n') + set -l tasks (grunt --version --verbose 2>/dev/null | awk '/Available tasks: / {$1=$2=""; print $0}' | awk '{$1=$1}1' | tr ' ' '\n') for t in $tasks echo $t end diff --git a/share/completions/gsettings.fish b/share/completions/gsettings.fish index 0dbe4bb0a..67d7575ef 100644 --- a/share/completions/gsettings.fish +++ b/share/completions/gsettings.fish @@ -27,11 +27,11 @@ function __fish_complete_gsettings_args if not set -q cmd[2] # Non-relocatable schemas - gsettings $schemadir list-schemas ^/dev/null + gsettings $schemadir list-schemas 2>/dev/null # Relocatable schemas require a dconf path, but there is no universal way of # finding the right paths to suggest here. Just default to '/'. - gsettings $schemadir list-relocatable-schemas ^/dev/null | string replace -r \$ ':/' + gsettings $schemadir list-relocatable-schemas 2>/dev/null | string replace -r \$ ':/' return 0 end @@ -42,7 +42,7 @@ function __fish_complete_gsettings_args set -l schema $cmd[2] if not set -q cmd[3] - gsettings $schemadir list-keys $schema ^/dev/null + gsettings $schemadir list-keys $schema 2>/dev/null return 0 end @@ -52,7 +52,7 @@ function __fish_complete_gsettings_args if not set -q cmd[4] set -l key $cmd[3] - set -l range (gsettings $schemadir range $schema $key ^/dev/null) + set -l range (gsettings $schemadir range $schema $key 2>/dev/null) set -l key_type $range[1] set -e range[1] switch $key_type @@ -64,7 +64,7 @@ function __fish_complete_gsettings_args case '*' # If no sensible suggestions can be made, just use the current value. # It gives a good indication on the expected format and is likely already close to what the user wants. - gsettings $schemadir get $schema $key ^/dev/null + gsettings $schemadir get $schema $key 2>/dev/null end return 0 end diff --git a/share/completions/head.fish b/share/completions/head.fish index 7e397d6a5..9539a392c 100644 --- a/share/completions/head.fish +++ b/share/completions/head.fish @@ -1,4 +1,4 @@ -if head --version >/dev/null ^/dev/null +if head --version >/dev/null 2>/dev/null complete -c head -s c -l bytes -d 'Print the first N bytes; Leading '-', truncate the last N bytes' -r complete -c head -s n -l lines -d 'Print the first N lines; Leading '-', truncate the last N lines' -r complete -c head -s q -l quiet -l silent -d 'Never print file names' diff --git a/share/completions/helm.fish b/share/completions/helm.fish index b2bf7ec8d..8e908b161 100644 --- a/share/completions/helm.fish +++ b/share/completions/helm.fish @@ -68,7 +68,7 @@ function __helm_subcommands -a cmd end function __helm_kube_contexts - kubectl config get-contexts -o name ^/dev/null + kubectl config get-contexts -o name 2>/dev/null end function __helm_kube_namespaces @@ -76,11 +76,11 @@ function __helm_kube_namespaces end function __helm_releases - helm ls --short ^/dev/null + helm ls --short 2>/dev/null end function __helm_release_completions - helm ls ^/dev/null | awk 'NR >= 2 { print $1"\tRelease of "$NF }' + helm ls 2>/dev/null | awk 'NR >= 2 { print $1"\tRelease of "$NF }' end function __helm_release_revisions diff --git a/share/completions/hg.fish b/share/completions/hg.fish index 19b722eb5..b82bbd555 100644 --- a/share/completions/hg.fish +++ b/share/completions/hg.fish @@ -34,7 +34,7 @@ function __fish_hg if set -l cwd (__fish_hg_get_cwd) set argv $argv --cwd $cwd end - command hg $argv ^ /dev/null + command hg $argv 2>/dev/null end function __fish_hg_commands diff --git a/share/completions/iptables.fish b/share/completions/iptables.fish index 843057191..c28f184c8 100644 --- a/share/completions/iptables.fish +++ b/share/completions/iptables.fish @@ -29,7 +29,7 @@ function __fish_iptables_user_chains set tablearg "--table=$table" end # This only works as root, so ignore errors - iptables $tablearg -L ^/dev/null | grep Chain | while read a b c + iptables $tablearg -L 2>/dev/null | grep Chain | while read a b c echo $b end end diff --git a/share/completions/journalctl.fish b/share/completions/journalctl.fish index f582f4e54..b8ce1068f 100644 --- a/share/completions/journalctl.fish +++ b/share/completions/journalctl.fish @@ -17,13 +17,13 @@ end function __fish_journalctl_field_values set -l token (commandline -t | cut -d"=" -f 1) - command journalctl -F $token ^ /dev/null | while read value + command journalctl -F $token 2>/dev/null | while read value echo $token=$value end end complete -c journalctl -n "not __fish_journalctl_is_field" -a '(__fish_journalctl_fields)' -d "Journal field" -f -complete -c journalctl -n "not __fish_journalctl_is_field" -a '(command journalctl -F _EXE ^/dev/null)' -d "Executable" +complete -c journalctl -n "not __fish_journalctl_is_field" -a '(command journalctl -F _EXE 2>/dev/null)' -d "Executable" complete -c journalctl -n "not __fish_journalctl_is_field" -a '+' -d "OR" complete -c journalctl -n "__fish_journalctl_is_field" -a '(__fish_journalctl_field_values)' -f -r diff --git a/share/completions/kill.fish b/share/completions/kill.fish index 81eff965c..c128aacd6 100644 --- a/share/completions/kill.fish +++ b/share/completions/kill.fish @@ -10,7 +10,7 @@ end complete -c kill -xa '(__fish_complete_pids)' -if kill -L > /dev/null ^ /dev/null +if kill -L > /dev/null 2>/dev/null complete -c kill -s s -l signal -d "Signal to send" complete -c kill -s l -l list -d "Printf list of signal names, or name of given SIG NUMBER" complete -c kill -s L -l table -d " Print signal names and their corresponding numbers" diff --git a/share/completions/killall.fish b/share/completions/killall.fish index b94fa2b03..4fd7bd802 100644 --- a/share/completions/killall.fish +++ b/share/completions/killall.fish @@ -21,7 +21,7 @@ end complete -c killall -xa '(__fish_complete_proc)' -if killall --version >/dev/null ^/dev/null # GNU +if killall --version >/dev/null 2>/dev/null # GNU complete -c killall -s e -l exact -d 'Require an exact match for very long names' complete -c killall -s I -l ignore-case -d 'Do case insensitive process name match' complete -c killall -s g -l process-group -d 'Kill the process group to which the process belongs. The kill signal is only sent once per group, even if multiple processes belonging to the same process group were found' diff --git a/share/completions/ls.fish b/share/completions/ls.fish index 27002768e..418a67a90 100644 --- a/share/completions/ls.fish +++ b/share/completions/ls.fish @@ -17,7 +17,7 @@ complete -c ls -s x -d "List entries by lines" complete -c ls -s 1 -d "List one file per line" # Test if we are using GNU ls -if command ls --version >/dev/null ^/dev/null +if command ls --version >/dev/null 2>/dev/null complete -c ls -s a -l all -d "Show hidden" complete -c ls -s A -l almost-all -d "Show hidden except . and .." complete -c ls -s F -l classify -d "Append filetype indicator" diff --git a/share/completions/lua.fish b/share/completions/lua.fish index 1bfc1257d..046fbaa9b 100644 --- a/share/completions/lua.fish +++ b/share/completions/lua.fish @@ -1,7 +1,7 @@ complete -c lua -s e -d 'Execute string' -x # Try the most common lib directories, silencing errors in case they don't exist. -complete -c lua -s l -d 'Require library' -xa "(find /usr/lib{,32,64}/lua/ -name \*.so -printf '%f\n' ^/dev/null | string replace -r '.so\$' '')" +complete -c lua -s l -d 'Require library' -xa "(find /usr/lib{,32,64}/lua/ -name \*.so -printf '%f\n' 2>/dev/null | string replace -r '.so\$' '')" complete -c lua -s i -d 'Enter interactive mode after executing script' complete -c lua -s v -d 'Show version' complete -c lua -s h -l help -d 'Print help and exit' diff --git a/share/completions/mkdir.fish b/share/completions/mkdir.fish index 638994852..1e863244b 100644 --- a/share/completions/mkdir.fish +++ b/share/completions/mkdir.fish @@ -1,6 +1,6 @@ # Checks if we are using GNU tools -if mkdir --version > /dev/null ^ /dev/null +if mkdir --version > /dev/null 2>/dev/null complete -c mkdir -l version -d 'Output version' complete -c mkdir -s m -l mode -d 'Set file mode (as in chmod)' -x complete -c mkdir -s p -l parents -d 'Make parent directories as needed' @@ -14,6 +14,6 @@ else end # Checks if SELinux is installed -if command -s sestatus > /dev/null ^ /dev/null +if command -s sestatus > /dev/null 2>/dev/null complete -c mkdir -l context -s Z -d 'Set SELinux security context of each created directory to the default type' end diff --git a/share/completions/mktemp.fish b/share/completions/mktemp.fish index 786359005..11dceb1a7 100644 --- a/share/completions/mktemp.fish +++ b/share/completions/mktemp.fish @@ -1,4 +1,4 @@ -if mktemp --version >/dev/null ^/dev/null # GNU +if mktemp --version >/dev/null 2>/dev/null # GNU complete -c mktemp -s d -l directory -d 'create a directory, not a file' complete -c mktemp -s u -l dry-run -d 'do not create anything; merely print a name (unsafe)' complete -c mktemp -s q -l quiet -d 'suppress diagnostics about file/dir-creation failure' diff --git a/share/completions/modinfo.fish b/share/completions/modinfo.fish index eca5014d2..765ab2846 100644 --- a/share/completions/modinfo.fish +++ b/share/completions/modinfo.fish @@ -1,4 +1,4 @@ -if command -s uname > /dev/null ^/dev/null +if command -s uname > /dev/null 2>/dev/null if test (uname) = "Linux" complete -c modinfo -a "(__fish_print_modules)" complete -c modinfo -l author -s a -d "Print only 'author'" diff --git a/share/completions/npm.fish b/share/completions/npm.fish index a04a50500..ad8d2b253 100644 --- a/share/completions/npm.fish +++ b/share/completions/npm.fish @@ -59,7 +59,7 @@ function __fish_complete_npm -d "Complete the commandline using npm's 'completio set COMP_CWORD (math $COMP_CWORD + 1) set COMP_LINE $COMP_LINE "" end - command npm completion -- $COMP_LINE ^/dev/null + command npm completion -- $COMP_LINE 2>/dev/null end end diff --git a/share/completions/pactl.fish b/share/completions/pactl.fish index ae6dec43b..499c162e0 100644 --- a/share/completions/pactl.fish +++ b/share/completions/pactl.fish @@ -27,11 +27,11 @@ end function __fish_pa_list_ports # Yes, this is localized - env LC_ALL=C pactl list cards ^/dev/null | sed -n -e '/Ports:/,$p' | string match -r '^\t\t\w.*$' | string replace -r '\s+([-+\w:]+): (\w.+)' '$1\t$2' + env LC_ALL=C pactl list cards 2>/dev/null | sed -n -e '/Ports:/,$p' | string match -r '^\t\t\w.*$' | string replace -r '\s+([-+\w:]+): (\w.+)' '$1\t$2' end function __fish_pa_list_profiles - env LC_ALL=C pactl list cards ^/dev/null | sed -n -e '/Profiles:/,/Active Profile/p' | string match -r '\t\t.*' | string replace -r '\s+([-+\w:]+): (\w.+)' '$1\t$2' + env LC_ALL=C pactl list cards 2>/dev/null | sed -n -e '/Profiles:/,/Active Profile/p' | string match -r '\t\t.*' | string replace -r '\s+([-+\w:]+): (\w.+)' '$1\t$2' end # This is needed to filter out loaded modules diff --git a/share/completions/passwd.fish b/share/completions/passwd.fish index 2ba059a3a..3d1052f07 100644 --- a/share/completions/passwd.fish +++ b/share/completions/passwd.fish @@ -7,7 +7,7 @@ function __fish_passwd_darwin_infosystem echo -e "nis\tRemote NIS server" end -if passwd --help >/dev/null ^&1 +if passwd --help >/dev/null 2>&1 complete -c passwd -n '__fish_contains_opt -s S status' -s a -l all -f -d "Display password state for all users" complete -c passwd -s d -l delete -f -d "Delete user password" complete -c passwd -s e -l expire -f -d "Immediately obsolete user password" diff --git a/share/completions/perl.fish b/share/completions/perl.fish index 19e8fd47a..b9af0d2d4 100644 --- a/share/completions/perl.fish +++ b/share/completions/perl.fish @@ -8,7 +8,7 @@ begin set -l unicode 'commandline | string match -qr -- "-[a-zA-Z]*C[a-zA-Z]*\$"' set -l noopt 'commandline | not string match -qr -- "-[a-zA-Z]*C[a-zA-Z]*\$"' - set -l modules "(find (perl -lE'print for @INC') -name '*.pm' -printf '%P\n' ^/dev/null \ + set -l modules "(find (perl -lE'print for @INC') -name '*.pm' -printf '%P\n' 2>/dev/null \ | sed -e 's,/,::,g; s,\.pm\$,,' | sort -u)" complete -c perl -s 0 -n $noopt -d 'Specify record separator' complete -c perl -s a -n $noopt -d 'Turn on autosplit mode' diff --git a/share/completions/psql.fish b/share/completions/psql.fish index f9dee6cd9..e5b6b4656 100644 --- a/share/completions/psql.fish +++ b/share/completions/psql.fish @@ -1,10 +1,10 @@ function __fish_complete_pg_database - psql -AtqwlF \t ^/dev/null | awk 'NF > 1 { print $1 }' + psql -AtqwlF \t 2>/dev/null | awk 'NF > 1 { print $1 }' end function __fish_complete_pg_user - psql -Atqwc 'select usename from pg_user' template1 ^/dev/null + psql -Atqwc 'select usename from pg_user' template1 2>/dev/null end complete -c psql --no-files -a '(__fish_complete_pg_database)' diff --git a/share/completions/rm.fish b/share/completions/rm.fish index 9cff038ae..15f68ae13 100644 --- a/share/completions/rm.fish +++ b/share/completions/rm.fish @@ -1,5 +1,5 @@ #Completions for rm -if rm --version >/dev/null ^/dev/null # GNU +if rm --version >/dev/null 2>/dev/null # GNU complete -c rm -s d -l directory -d "Unlink directory (Only by superuser)" complete -c rm -s f -l force -d "Never prompt before removal" complete -c rm -s i -l interactive -d "Prompt before removal" diff --git a/share/completions/rsync.fish b/share/completions/rsync.fish index dc866c4ba..80f2d2685 100644 --- a/share/completions/rsync.fish +++ b/share/completions/rsync.fish @@ -130,6 +130,6 @@ complete -c rsync -d "Remote path" -n "commandline -ct | string match -q '*:*'" __rsync_remote_target )( # Get the list of remote files from the specified rsync server. - rsync --list-only (__rsync_remote_target) ^/dev/null | string replace -r '^d.*' '\$0/' | tr -s ' ' | cut -d' ' -f 5- + rsync --list-only (__rsync_remote_target) 2>/dev/null | string replace -r '^d.*' '\$0/' | tr -s ' ' | cut -d' ' -f 5- ) " diff --git a/share/completions/sed.fish b/share/completions/sed.fish index 657ead2fe..e4dd44c9c 100644 --- a/share/completions/sed.fish +++ b/share/completions/sed.fish @@ -5,7 +5,7 @@ # Test if we are using GNU sed set -l is_gnu -sed --version >/dev/null ^/dev/null; and set is_gnu --is-gnu +sed --version >/dev/null 2>/dev/null; and set is_gnu --is-gnu # Shared ls switches diff --git a/share/completions/seq.fish b/share/completions/seq.fish index 69760099d..e7fe74cae 100644 --- a/share/completions/seq.fish +++ b/share/completions/seq.fish @@ -1,4 +1,4 @@ -if seq --version ^ /dev/null > /dev/null #GNU +if seq --version 2>/dev/null > /dev/null #GNU complete -c seq -s f -l format -d 'Use printf style floating-point FORMAT' complete -c seq -s s -l separator -d 'Use STRING to separate numbers' complete -c seq -s w -l equal-width -d 'Equalize width with leading zeroes' diff --git a/share/completions/ssh.fish b/share/completions/ssh.fish index b90c7117e..4950b2082 100644 --- a/share/completions/ssh.fish +++ b/share/completions/ssh.fish @@ -19,7 +19,7 @@ complete -c ssh -s a -d "Disables forwarding of the authentication agent" complete -c ssh -s A -d "Enables forwarding of the authentication agent" # TODO: Improve this since /proc/net/arp is not POSIX compliant. complete -x -c ssh -s b -d "Interface to transmit from" -a " -(cut -d ' ' -f 1 /proc/net/arp ^/dev/null | string match -r -v '^IP') +(cut -d ' ' -f 1 /proc/net/arp 2>/dev/null | string match -r -v '^IP') " complete -x -c ssh -s e -d "Escape character" -a "\^ none" diff --git a/share/completions/stat.fish b/share/completions/stat.fish index a87ca02a1..9a540feb1 100644 --- a/share/completions/stat.fish +++ b/share/completions/stat.fish @@ -1,4 +1,4 @@ -if stat --version ^ /dev/null > /dev/null # GNU +if stat --version 2>/dev/null > /dev/null # GNU complete -c stat -s L -l dereference -d 'follow links' complete -c stat -s f -l file-system -d 'display file system status instead of file status' complete -c stat -s c -l format -x -d 'use the specified FORMAT instead of the default; output a newline after each use of FORMAT' diff --git a/share/completions/sysctl.fish b/share/completions/sysctl.fish index aaa32f04c..5736d93b6 100644 --- a/share/completions/sysctl.fish +++ b/share/completions/sysctl.fish @@ -1,9 +1,9 @@ if type -q -f sysctl # Only GNU and BSD sysctl seem to know "-h", so others should exit non-zero - if sysctl -h >/dev/null ^/dev/null + if sysctl -h >/dev/null 2>/dev/null # Print sysctl keys and values, separated by a tab function __fish_sysctl_values - sysctl -a ^/dev/null | string replace -a " = " \t + sysctl -a 2>/dev/null | string replace -a " = " \t end complete -c sysctl -a '(__fish_sysctl_values)' -f @@ -32,7 +32,7 @@ if type -q -f sysctl else # OSX sysctl function __fish_sysctl_values - sysctl -a ^/dev/null | string replace -a ":" \t + sysctl -a 2>/dev/null | string replace -a ":" \t end complete -c sysctl -a '(__fish_sysctl_values)' -f diff --git a/share/completions/tail.fish b/share/completions/tail.fish index 72a6793c4..b3daaae61 100644 --- a/share/completions/tail.fish +++ b/share/completions/tail.fish @@ -1,4 +1,4 @@ -if tail --version > /dev/null ^ /dev/null +if tail --version > /dev/null 2>/dev/null complete -c tail -s c -l bytes -x -d 'output the last K bytes; alternatively, use -c +K to output bytes starting with the Kth of each file' complete -c tail -s f -l follow -a 'name descriptor' -d 'output appended data as the file grows; -f -l follow, and --follow=descriptor are equivalent' complete -c tail -s F -d 'same as --follow=name --retry' diff --git a/share/completions/tmux.fish b/share/completions/tmux.fish index 2072ccf9b..9a5e3569e 100644 --- a/share/completions/tmux.fish +++ b/share/completions/tmux.fish @@ -1,20 +1,20 @@ function __fish_tmux_sessions -d 'available sessions' - tmux list-sessions -F "#S #{session_windows} windows created: #{session_created_string} [#{session_width}x#{session_height}]#{session_attached}" | sed 's/0$//;s/1$/ (attached)/' ^/dev/null + tmux list-sessions -F "#S #{session_windows} windows created: #{session_created_string} [#{session_width}x#{session_height}]#{session_attached}" | sed 's/0$//;s/1$/ (attached)/' 2>/dev/null end function __fish_tmux_clients -d 'connected clients' - tmux list-clients -F "#{client_tty} #S: Created: #{client_created_string} [#{client_width}x#{client_height} #{client_termname}]" ^/dev/null + tmux list-clients -F "#{client_tty} #S: Created: #{client_created_string} [#{client_width}x#{client_height} #{client_termname}]" 2>/dev/null end function __fish_tmux_panes -d 'window panes' #fully qualified pane names - tmux list-panes -F '#S:#W.#P session:window.pane' ^/dev/null + tmux list-panes -F '#S:#W.#P session:window.pane' 2>/dev/null #panes by themselves - tmux list-panes -F '#P pane' ^/dev/null + tmux list-panes -F '#P pane' 2>/dev/null #windows by themselves - tmux list-panes -F '#W window' ^/dev/null + tmux list-panes -F '#W window' 2>/dev/null end #don't allow dirs in the completion list... diff --git a/share/completions/touch.fish b/share/completions/touch.fish index fb2a1f513..8dc69477e 100644 --- a/share/completions/touch.fish +++ b/share/completions/touch.fish @@ -1,4 +1,4 @@ -if touch --version ^ /dev/null > /dev/null # GNU +if touch --version 2>/dev/null > /dev/null # GNU complete -c touch -s a -d "Change access time" complete -c touch -s B -l backward -x -d "Set date back" complete -c touch -s c -l no-create -d "Do not create file" diff --git a/share/completions/tr.fish b/share/completions/tr.fish index 5d247c81d..cc450897d 100644 --- a/share/completions/tr.fish +++ b/share/completions/tr.fish @@ -3,7 +3,7 @@ # # Test if we are using GNU tr -if command tr --version >/dev/null ^/dev/null +if command tr --version >/dev/null 2>/dev/null complete -c tr -x complete -c tr -s c -s C -l complement -d 'use the complement of SET1' complete -c tr -s d -l delete -d 'delete characters in SET1, do not translate' diff --git a/share/completions/uniq.fish b/share/completions/uniq.fish index c03d14a24..e02062571 100644 --- a/share/completions/uniq.fish +++ b/share/completions/uniq.fish @@ -1,4 +1,4 @@ -if uniq --version > /dev/null ^ /dev/null +if uniq --version > /dev/null 2>/dev/null complete -c uniq -s c -l count -d "Print number of occurences" complete -c uniq -s d -l repeated -d "Only print duplicates" complete -c uniq -s D -l all-repeated -d "Remove non-duplicate lines" -f -x -a " diff --git a/share/completions/valgrind.fish b/share/completions/valgrind.fish index bc6614114..eabcaf135 100644 --- a/share/completions/valgrind.fish +++ b/share/completions/valgrind.fish @@ -1,7 +1,7 @@ # Don't go invoking valgrind unless it is installed set -l skin tool -if type -q valgrind; and valgrind --version ^/dev/null | string match -qr -- '-2\.[012]\.' +if type -q valgrind; and valgrind --version 2>/dev/null | string match -qr -- '-2\.[012]\.' # In older versions of Valgrind, the skin selection option was # '--skin' # But someone decided that it would be fun to change this to diff --git a/share/completions/vi.fish b/share/completions/vi.fish index 52390c178..74efc1028 100644 --- a/share/completions/vi.fish +++ b/share/completions/vi.fish @@ -6,7 +6,7 @@ # Check if vi exists at all ( needed for vi --version ) if type -q vi # Check if vi is really vim - if vi --version > /dev/null ^ /dev/null + if vi --version > /dev/null 2>/dev/null complete -c vi -w vim else complete -c vi -s s -d 'Suppress all interactive user feedback' diff --git a/share/completions/which.fish b/share/completions/which.fish index d94683688..aaca38272 100644 --- a/share/completions/which.fish +++ b/share/completions/which.fish @@ -1,4 +1,4 @@ -if which -v > /dev/null ^ /dev/null # GNU +if which -v > /dev/null 2>/dev/null # GNU complete -c which -s a -l all -d "Print all matching executables in PATH, not just the first" complete -c which -s i -l read-alias -d "Read aliases from stdin, reporting matching ones on stdout" complete -c which -l skip-alias -d "Ignore option '--read-alias'" diff --git a/share/functions/__fish_complete_lpr_option.fish b/share/functions/__fish_complete_lpr_option.fish index eccb6bdb6..637923d03 100644 --- a/share/functions/__fish_complete_lpr_option.fish +++ b/share/functions/__fish_complete_lpr_option.fish @@ -4,7 +4,7 @@ function __fish_complete_lpr_option --description 'Complete lpr option' case '*=*' string split -m1 = -- "$optstr" | read -l opt val set -l descr - for l in (lpoptions -l ^/dev/null | string match -- "*$opt*" | string replace -r '.*/(.*):\s*(.*)$' '$1 $2' | string split " ") + for l in (lpoptions -l 2>/dev/null | string match -- "*$opt*" | string replace -r '.*/(.*):\s*(.*)$' '$1 $2' | string split " ") if not set -q descr[1] set descr $l continue @@ -17,7 +17,7 @@ function __fish_complete_lpr_option --description 'Complete lpr option' echo $opt=$l\t$default$descr end case '*' - lpoptions -l ^/dev/null | string replace -r '(.*)/(.*):.*$' '$1=\t$2' + lpoptions -l 2>/dev/null | string replace -r '(.*)/(.*):.*$' '$1=\t$2' end diff --git a/share/functions/__fish_complete_man.fish b/share/functions/__fish_complete_man.fish index 5061e5271..e65d61c07 100644 --- a/share/functions/__fish_complete_man.fish +++ b/share/functions/__fish_complete_man.fish @@ -30,7 +30,7 @@ function __fish_complete_man if test -n "$token" # Do the actual search - apropos $token ^/dev/null | awk ' + apropos $token 2>/dev/null | awk ' BEGIN { FS="[\t ]- "; OFS="\t"; } # BSD/Darwin /^[^( \t]+\('$section'\)/ { diff --git a/share/functions/__fish_complete_subcommand_root.fish b/share/functions/__fish_complete_subcommand_root.fish index 736abeeff..d434d0cbb 100644 --- a/share/functions/__fish_complete_subcommand_root.fish +++ b/share/functions/__fish_complete_subcommand_root.fish @@ -1,4 +1,4 @@ function __fish_complete_subcommand_root -d "Run the __fish_complete_subcommand function using a PATH containing /sbin and /usr/sbin" - set -lx -p PATH /sbin /usr/sbin ^/dev/null + set -lx -p PATH /sbin /usr/sbin 2>/dev/null __fish_complete_subcommand $argv end diff --git a/share/functions/__fish_complete_zfs_rw_properties.fish b/share/functions/__fish_complete_zfs_rw_properties.fish index b90cd809b..ebc8572e9 100644 --- a/share/functions/__fish_complete_zfs_rw_properties.fish +++ b/share/functions/__fish_complete_zfs_rw_properties.fish @@ -93,5 +93,5 @@ function __fish_complete_zfs_rw_properties -d "Completes with ZFS read-write pro echo -e "volmode\t"(_ "How to expose volumes to OS")" (default, geom, dev, none)" end # User properties; the /dev/null redirection masks the possible "no datasets available" - zfs list -o all ^/dev/null | head -n 1 | string replace -a -r "\s+" "\n" | string match -e ":" | string lower + zfs list -o all 2>/dev/null | head -n 1 | string replace -a -r "\s+" "\n" | string match -e ":" | string lower end diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 44f49b284..7f0a0a6a4 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -133,11 +133,11 @@ function __fish_config_interactive -d "Initializations that should be performed # c_m_p.py should work with any python version. set -l update_args -B $__fish_data_dir/tools/create_manpage_completions.py --manpath --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions' if command -qs python3 - python3 $update_args >/dev/null ^/dev/null & + python3 $update_args >/dev/null 2>/dev/null & else if command -qs python2 - python2 $update_args >/dev/null ^/dev/null & + python2 $update_args >/dev/null 2>/dev/null & else if command -qs python - python $update_args >/dev/null ^/dev/null & + python $update_args >/dev/null 2>/dev/null & end end end @@ -165,14 +165,14 @@ function __fish_config_interactive -d "Initializations that should be performed function __fish_repaint --on-variable fish_color_cwd --description "Event handler, repaints the prompt when fish_color_cwd changes" if status --is-interactive set -e __fish_prompt_cwd - commandline -f repaint ^/dev/null + commandline -f repaint 2>/dev/null end end function __fish_repaint_root --on-variable fish_color_cwd_root --description "Event handler, repaints the prompt when fish_color_cwd_root changes" if status --is-interactive set -e __fish_prompt_cwd - commandline -f repaint ^/dev/null + commandline -f repaint 2>/dev/null end end @@ -231,13 +231,13 @@ function __fish_config_interactive -d "Initializations that should be performed set -g fish_bind_mode default if test "$fish_key_bindings" = fish_default_key_bindings # Redirect stderr per #1155 - fish_default_key_bindings ^/dev/null + fish_default_key_bindings 2>/dev/null else - eval $fish_key_bindings ^/dev/null + eval $fish_key_bindings 2>/dev/null end # Load user key bindings if they are defined if functions --query fish_user_key_bindings >/dev/null - fish_user_key_bindings ^/dev/null + fish_user_key_bindings 2>/dev/null end end @@ -326,7 +326,7 @@ function __fish_config_interactive -d "Initializations that should be performed # it ships with example handlers for bash and zsh, so we'll follow that format else if type -p -q pkgfile function __fish_command_not_found_handler --on-event fish_command_not_found - set -l __packages (pkgfile --binaries --verbose -- $argv[1] ^/dev/null) + set -l __packages (pkgfile --binaries --verbose -- $argv[1] 2>/dev/null) if test $status -eq 0 printf "%s may be found in the following packages:\n" "$argv[1]" printf " %s\n" $__packages diff --git a/share/functions/__fish_describe_command.fish b/share/functions/__fish_describe_command.fish index df2efc8d5..43936c4be 100644 --- a/share/functions/__fish_describe_command.fish +++ b/share/functions/__fish_describe_command.fish @@ -3,7 +3,7 @@ # function __fish_describe_command -d "Command used to find descriptions for commands" - apropos $argv ^/dev/null | awk -v FS=" +- +" '{ + apropos $argv 2>/dev/null | awk -v FS=" +- +" '{ split($1, names, ", "); for (name in names) if (names[name] ~ /^'"$argv"'.* *\([18]\)/ ) { diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 8ad0b56cb..e70753445 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -193,7 +193,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi set -l svn_remote # get some config options from git-config - command git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' ^/dev/null | while read -lz key value + command git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | while read -lz key value switch $key case bash.showupstream set show_upstream $value @@ -241,7 +241,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi case svn\* # get the upstream from the 'git-svn-id: …' in a commit message # (git-svn uses essentially the same procedure internally) - set -l svn_upstream (git log --first-parent -1 --grep="^git-svn-id: \($svn_url_pattern\)" ^/dev/null) + set -l svn_upstream (git log --first-parent -1 --grep="^git-svn-id: \($svn_url_pattern\)" 2>/dev/null) if test (count $svn_upstream) -ne 0 echo $svn_upstream[-1] | read -l __ svn_upstream __ set svn_upstream (string replace -r '@.*' '' -- $svn_upstream) @@ -280,7 +280,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi end # Find how many commits we are ahead/behind our upstream - set count (command git rev-list --count --left-right $upstream...HEAD ^/dev/null) + set count (command git rev-list --count --left-right $upstream...HEAD 2>/dev/null) # calculate the result if test -n "$verbose" @@ -304,7 +304,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi echo "$prefix$___fish_git_prompt_char_upstream_diverged$ahead-$behind" end if test -n "$count" -a -n "$name" - echo " "(command git rev-parse --abbrev-ref "$upstream" ^/dev/null) + echo " "(command git rev-parse --abbrev-ref "$upstream" 2>/dev/null) end else if test -n "$informative" echo $count | read -l behind ahead @@ -339,7 +339,7 @@ function __fish_git_prompt --description "Prompt function for Git" if not command -sq git return 1 end - set -l repo_info (command git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree HEAD ^/dev/null) + set -l repo_info (command git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree HEAD 2>/dev/null) test -n "$repo_info" or return @@ -387,7 +387,7 @@ function __fish_git_prompt --description "Prompt function for Git" if set -q __fish_git_prompt_showuntrackedfiles set -l config (command git config --bool bash.showUntrackedFiles) if test "$config" != false - if command git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- '*' >/dev/null ^/dev/null + if command git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- '*' >/dev/null 2>/dev/null set u $___fish_git_prompt_char_untrackedfiles end end @@ -463,7 +463,7 @@ function __fish_git_prompt_staged --description "__fish_git_prompt helper, tells set -l staged if test -n "$sha" - command git diff-index --cached --quiet HEAD -- ^/dev/null + command git diff-index --cached --quiet HEAD -- 2>/dev/null or set staged $___fish_git_prompt_char_stagedstate else set staged $___fish_git_prompt_char_invalidstate @@ -475,7 +475,7 @@ function __fish_git_prompt_dirty --description "__fish_git_prompt helper, tells set -l dirty set -l os - command git diff --no-ext-diff --quiet --exit-code ^/dev/null + command git diff --no-ext-diff --quiet --exit-code 2>/dev/null set os $status if test $os -ne 0 set dirty $___fish_git_prompt_char_dirtystate @@ -487,7 +487,7 @@ set -g ___fish_git_prompt_status_order stagedstate invalidstate dirtystate untra function __fish_git_prompt_informative_status - set -l changedFiles (command git diff --name-status ^/dev/null | string match -r \\w) + set -l changedFiles (command git diff --name-status 2>/dev/null | string match -r \\w) set -l stagedFiles (command git diff --staged --name-status | string match -r \\w) set -l x (count $changedFiles) @@ -501,7 +501,7 @@ function __fish_git_prompt_informative_status set -l info # If `math` fails for some reason, assume the state is clean - it's the simpler path - set -l state (math $dirtystate + $invalidstate + $stagedstate + $untrackedfiles ^/dev/null) + set -l state (math $dirtystate + $invalidstate + $stagedstate + $untrackedfiles 2>/dev/null) if test -z "$state" or test "$state" = 0 set info $___fish_git_prompt_color_cleanstate$___fish_git_prompt_char_cleanstate$___fish_git_prompt_color_cleanstate_done @@ -549,9 +549,9 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp set -l os if test -d $git_dir/rebase-merge - set branch (cat $git_dir/rebase-merge/head-name ^/dev/null) - set step (cat $git_dir/rebase-merge/msgnum ^/dev/null) - set total (cat $git_dir/rebase-merge/end ^/dev/null) + set branch (cat $git_dir/rebase-merge/head-name 2>/dev/null) + set step (cat $git_dir/rebase-merge/msgnum 2>/dev/null) + set total (cat $git_dir/rebase-merge/end 2>/dev/null) if test -f $git_dir/rebase-merge/interactive set operation "|REBASE-i" else @@ -559,10 +559,10 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp end else if test -d $git_dir/rebase-apply - set step (cat $git_dir/rebase-apply/next ^/dev/null) - set total (cat $git_dir/rebase-apply/last ^/dev/null) + set step (cat $git_dir/rebase-apply/next 2>/dev/null) + set total (cat $git_dir/rebase-apply/last 2>/dev/null) if test -f $git_dir/rebase-apply/rebasing - set branch (cat $git_dir/rebase-apply/head-name ^/dev/null) + set branch (cat $git_dir/rebase-apply/head-name 2>/dev/null) set operation "|REBASE" else if test -f $git_dir/rebase-apply/applying set operation "|AM" @@ -585,7 +585,7 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp end if test -z "$branch" - set branch (command git symbolic-ref HEAD ^/dev/null; set os $status) + set branch (command git symbolic-ref HEAD 2>/dev/null; set os $status) if test $os -ne 0 set detached yes set branch (switch "$__fish_git_prompt_describe_style" @@ -597,7 +597,7 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp command git describe HEAD case default '*' command git describe --tags --exact-match HEAD - end ^/dev/null; set os $status) + end 2>/dev/null; set os $status) if test $os -ne 0 # Shorten the sha ourselves to 8 characters - this should be good for most repositories, # and even for large ones it should be good for most commits @@ -750,7 +750,7 @@ function __fish_git_prompt_repaint $varargs --description "Event handler, repain end end - commandline -f repaint ^/dev/null + commandline -f repaint 2>/dev/null end end @@ -771,7 +771,7 @@ function __fish_git_prompt_repaint_color $varargs --description "Event handler, set -e ___fish_git_prompt_color_{$name}_done end end - commandline -f repaint ^/dev/null + commandline -f repaint 2>/dev/null end end @@ -782,6 +782,6 @@ end function __fish_git_prompt_repaint_char $varargs --description "Event handler, repaints prompt when any char changes" if status --is-interactive set -e _$argv[3] - commandline -f repaint ^/dev/null + commandline -f repaint 2>/dev/null end end diff --git a/share/functions/__fish_hg_prompt.fish b/share/functions/__fish_hg_prompt.fish index 0ab444514..9e7663053 100644 --- a/share/functions/__fish_hg_prompt.fish +++ b/share/functions/__fish_hg_prompt.fish @@ -45,8 +45,8 @@ function __fish_hg_prompt --description 'Write out the hg prompt' end # Read branch and bookmark - set -l branch (cat $root/branch ^/dev/null; or echo default) - if set -l bookmark (cat $root/bookmarks.current ^/dev/null) + set -l branch (cat $root/branch 2>/dev/null; or echo default) + if set -l bookmark (cat $root/bookmarks.current 2>/dev/null) set branch "$branch|$bookmark" end diff --git a/share/functions/__fish_is_git_repository.fish b/share/functions/__fish_is_git_repository.fish index 8c7558278..57046b890 100644 --- a/share/functions/__fish_is_git_repository.fish +++ b/share/functions/__fish_is_git_repository.fish @@ -1,3 +1,3 @@ function __fish_is_git_repository --description 'Check if the current directory is a git repository' - git rev-parse --is-inside-work-tree ^/dev/null >/dev/null + git rev-parse --is-inside-work-tree 2>/dev/null >/dev/null end diff --git a/share/functions/__fish_make_completion_signals.fish b/share/functions/__fish_make_completion_signals.fish index cac6e135f..8c6c930c0 100644 --- a/share/functions/__fish_make_completion_signals.fish +++ b/share/functions/__fish_make_completion_signals.fish @@ -13,8 +13,8 @@ function __fish_make_completion_signals --description 'Make list of kill signals # The procps `kill -L` produces a more compact table. We can distinguish the two cases by # testing whether it supports `kill -t`; in which case it is the coreutils `kill` command. # Darwin doesn't have kill -t or kill -L - if kill -t ^/dev/null >/dev/null - or not kill -L ^/dev/null >/dev/null + if kill -t 2>/dev/null >/dev/null + or not kill -L 2>/dev/null >/dev/null # Posix systems print out the name of a signal using 'kill -l SIGNUM'. complete -c kill -s l --description "List names of available signals" for i in (seq 31) diff --git a/share/functions/__fish_man_page.fish b/share/functions/__fish_man_page.fish index 8bc32b76f..5c490cc6a 100644 --- a/share/functions/__fish_man_page.fish +++ b/share/functions/__fish_man_page.fish @@ -12,11 +12,11 @@ function __fish_man_page # Try "man first-second" and fall back to "man first" if that doesn't work out. set -l maincmd (basename $args[1]) if set -q args[2] - man "$maincmd-$args[2]" ^/dev/null - or man "$maincmd" ^/dev/null + man "$maincmd-$args[2]" 2>/dev/null + or man "$maincmd" 2>/dev/null or printf \a else - man "$maincmd" ^/dev/null + man "$maincmd" 2>/dev/null or printf \a end diff --git a/share/functions/__fish_paginate.fish b/share/functions/__fish_paginate.fish index 848392b4e..937c5c6de 100644 --- a/share/functions/__fish_paginate.fish +++ b/share/functions/__fish_paginate.fish @@ -11,7 +11,7 @@ function __fish_paginate -d "Paginate the current command using the users defaul if commandline -j | string match -q -r -v "$cmd *\$" - commandline -aj " ^&1 | $cmd;" + commandline -aj " 2>&1 | $cmd;" end end diff --git a/share/functions/__fish_portage_print_available_categories.fish b/share/functions/__fish_portage_print_available_categories.fish index ad3121cf1..21734c0ed 100644 --- a/share/functions/__fish_portage_print_available_categories.fish +++ b/share/functions/__fish_portage_print_available_categories.fish @@ -1,3 +1,3 @@ function __fish_portage_print_available_categories --description 'Print all available categories' - cat (__fish_portage_print_repository_paths)/profiles/categories ^ /dev/null + cat (__fish_portage_print_repository_paths)/profiles/categories 2>/dev/null end diff --git a/share/functions/__fish_print_help.fish b/share/functions/__fish_print_help.fish index 5f51b46e4..ff7668912 100644 --- a/share/functions/__fish_print_help.fish +++ b/share/functions/__fish_print_help.fish @@ -43,9 +43,9 @@ function __fish_print_help --description "Print help message for the specified f set mfish -mfish end if test -e "$__fish_data_dir/man/man1/$item.1" - set help (nroff -c -man $mfish -t $rLL "$__fish_data_dir/man/man1/$item.1" ^/dev/null) + set help (nroff -c -man $mfish -t $rLL "$__fish_data_dir/man/man1/$item.1" 2>/dev/null) else if test -e "$__fish_data_dir/man/man1/$item.1.gz" - set help (gunzip -c "$__fish_data_dir/man/man1/$item.1.gz" ^/dev/null | nroff -c -man $mfish -t $rLL ^/dev/null) + set help (gunzip -c "$__fish_data_dir/man/man1/$item.1.gz" 2>/dev/null | nroff -c -man $mfish -t $rLL 2>/dev/null) end # The original implementation trimmed off the top 5 lines and bottom 3 lines diff --git a/share/functions/__fish_print_lpr_options.fish b/share/functions/__fish_print_lpr_options.fish index 1e5ba97a1..9227031f9 100644 --- a/share/functions/__fish_print_lpr_options.fish +++ b/share/functions/__fish_print_lpr_options.fish @@ -1,4 +1,4 @@ function __fish_print_lpr_options --description 'Print lpr options' - lpoptions -l ^/dev/null | sed 's+\(.*\)/\(.*\):.*$+\1\t\2+' + lpoptions -l 2>/dev/null | sed 's+\(.*\)/\(.*\):.*$+\1\t\2+' end diff --git a/share/functions/__fish_print_lpr_printers.fish b/share/functions/__fish_print_lpr_printers.fish index a6fbb0c43..b070a16b2 100644 --- a/share/functions/__fish_print_lpr_printers.fish +++ b/share/functions/__fish_print_lpr_printers.fish @@ -1,5 +1,5 @@ function __fish_print_lpr_printers --description 'Print lpr printers' - lpstat -p ^/dev/null | sed 's/^\S*\s\(\S*\)\s\(.*\)$/\1\t\2/' + lpstat -p 2>/dev/null | sed 's/^\S*\s\(\S*\)\s\(.*\)$/\1\t\2/' end diff --git a/share/functions/__fish_print_make_targets.fish b/share/functions/__fish_print_make_targets.fish index c38e1b130..acb1a9fcf 100644 --- a/share/functions/__fish_print_make_targets.fish +++ b/share/functions/__fish_print_make_targets.fish @@ -17,7 +17,7 @@ function __fish_print_make_targets --argument-names directory file end set -l bsd_make - if make -C $directory -pn >/dev/null ^/dev/null + if make -C $directory -pn >/dev/null 2>/dev/null set bsd_make 0 else set bsd_make 1 @@ -25,9 +25,9 @@ function __fish_print_make_targets --argument-names directory file if test "$bsd_make" = 0 # https://stackoverflow.com/a/26339924 - make -C "$directory" -f "$file" -pRrq : ^/dev/null | awk -v RS= -F: '/^# Files/,/^# Finished Make data base/ {if ($1 !~ "^[#.]") {print $1}}' ^/dev/null + make -C "$directory" -f "$file" -pRrq : 2>/dev/null | awk -v RS= -F: '/^# Files/,/^# Finished Make data base/ {if ($1 !~ "^[#.]") {print $1}}' 2>/dev/null else - make -C "$directory" -f "$file" -d g1 -rn >/dev/null ^| awk -F, '/^#\*\*\* Input graph:/,/^$/ {if ($1 !~ "^#... ") {gsub(/# /,"",$1); print $1}}' ^/dev/null + make -C "$directory" -f "$file" -d g1 -rn >/dev/null 2>| awk -F, '/^#\*\*\* Input graph:/,/^$/ {if ($1 !~ "^#... ") {gsub(/# /,"",$1); print $1}}' 2>/dev/null end end diff --git a/share/functions/__fish_print_modules.fish b/share/functions/__fish_print_modules.fish index b52dd1535..388072e93 100644 --- a/share/functions/__fish_print_modules.fish +++ b/share/functions/__fish_print_modules.fish @@ -1,4 +1,4 @@ # Helper function for completions that need to enumerate Linux modules function __fish_print_modules - find /lib/modules/(uname -r)/{kernel,misc} -type f ^/dev/null | sed -e 's$/.*/\([^/.]*\).*$\1$' + find /lib/modules/(uname -r)/{kernel,misc} -type f 2>/dev/null | sed -e 's$/.*/\([^/.]*\).*$\1$' end diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish index e4a7c3ff9..9c8e489ed 100644 --- a/share/functions/__fish_print_packages.fish +++ b/share/functions/__fish_print_packages.fish @@ -21,7 +21,7 @@ function __fish_print_packages if type -q -f apt-cache # Do not generate the cache as apparently sometimes this is slow. # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550 - apt-cache --no-generate pkgnames (commandline -ct) ^/dev/null | sed -e 's/$/'\t$package'/' + apt-cache --no-generate pkgnames (commandline -ct) 2>/dev/null | sed -e 's/$/'\t$package'/' return end diff --git a/share/functions/__fish_print_service_names.fish b/share/functions/__fish_print_service_names.fish index 70519859f..134dc0b93 100644 --- a/share/functions/__fish_print_service_names.fish +++ b/share/functions/__fish_print_service_names.fish @@ -3,7 +3,7 @@ function __fish_print_service_names -d 'All services known to the system' # For the `service` command, this needs to be without the type suffix # on Debian at least __fish_systemctl_services | string replace -r '.service$' '' - else if type -f rc-service ^/dev/null # OpenRC (Gentoo) + else if type -f rc-service 2>/dev/null # OpenRC (Gentoo) command rc-service -l else if test -d /etc/init.d # SysV on Debian and other linuxen string replace '/etc/init.d/' '' -- /etc/init.d/* diff --git a/share/functions/__fish_print_xdg_mimetypes.fish b/share/functions/__fish_print_xdg_mimetypes.fish index ec7252f44..97070e042 100644 --- a/share/functions/__fish_print_xdg_mimetypes.fish +++ b/share/functions/__fish_print_xdg_mimetypes.fish @@ -1,3 +1,3 @@ function __fish_print_xdg_mimetypes --description 'Print XDG mime types' - cat (__fish_print_xdg_applications_directories)/mimeinfo.cache ^/dev/null | string match -v '[MIME Cache]' | string replace = \t + cat (__fish_print_xdg_applications_directories)/mimeinfo.cache 2>/dev/null | string match -v '[MIME Cache]' | string replace = \t end diff --git a/share/functions/__fish_svn_prompt.fish b/share/functions/__fish_svn_prompt.fish index 5c649c2cd..0cae12cf4 100644 --- a/share/functions/__fish_svn_prompt.fish +++ b/share/functions/__fish_svn_prompt.fish @@ -96,7 +96,7 @@ function __fish_svn_prompt --description "Prompt function for svn" end # make sure that this is a svn repo - set -l checkout_info (command svn info ^/dev/null) + set -l checkout_info (command svn info 2>/dev/null) if [ $status -ne 0 ] return diff --git a/share/functions/__fish_systemctl_services.fish b/share/functions/__fish_systemctl_services.fish index c80f7333d..57251a20e 100644 --- a/share/functions/__fish_systemctl_services.fish +++ b/share/functions/__fish_systemctl_services.fish @@ -1,13 +1,13 @@ function __fish_systemctl_services if type -q systemctl if __fish_contains_opt user - systemctl --user list-unit-files --no-legend --type=service ^/dev/null $argv | cut -f 1 -d ' ' - systemctl --user list-units --state=loaded --no-legend --type=service ^/dev/null | cut -f 1 -d ' ' + systemctl --user list-unit-files --no-legend --type=service 2>/dev/null $argv | cut -f 1 -d ' ' + systemctl --user list-units --state=loaded --no-legend --type=service 2>/dev/null | cut -f 1 -d ' ' else # list-unit-files will also show disabled units - systemctl list-unit-files --no-legend --type=service ^/dev/null $argv | cut -f 1 -d ' ' + systemctl list-unit-files --no-legend --type=service 2>/dev/null $argv | cut -f 1 -d ' ' # list-units will not show disabled units but will show instances (like wpa_supplicant@wlan0.service) - systemctl list-units --state=loaded --no-legend --type=service ^/dev/null | cut -f 1 -d ' ' + systemctl list-units --state=loaded --no-legend --type=service 2>/dev/null | cut -f 1 -d ' ' end end end diff --git a/share/functions/__terlar_git_prompt.fish b/share/functions/__terlar_git_prompt.fish index f1fcedf33..170f8e08c 100644 --- a/share/functions/__terlar_git_prompt.fish +++ b/share/functions/__terlar_git_prompt.fish @@ -26,14 +26,14 @@ function __terlar_git_prompt --description 'Write out the git prompt' if not command -sq git return 1 end - set -l branch (git rev-parse --abbrev-ref HEAD ^/dev/null) + set -l branch (git rev-parse --abbrev-ref HEAD 2>/dev/null) if test -z $branch return end echo -n '|' - set -l index (git status --porcelain ^/dev/null|cut -c 1-2|sort -u) + set -l index (git status --porcelain 2>/dev/null|cut -c 1-2|sort -u) if test -z "$index" set_color $fish_color_git_clean diff --git a/share/functions/_fish_systemctl.fish b/share/functions/_fish_systemctl.fish index 0baee21ca..669bd41e5 100644 --- a/share/functions/_fish_systemctl.fish +++ b/share/functions/_fish_systemctl.fish @@ -15,7 +15,7 @@ function _fish_systemctl --description 'Call systemctl with some options from th set -l args $argv set -l cmdline (commandline -opc) (commandline -ct) set -e cmdline[1] - argparse $opts -- $cmdline ^/dev/null + argparse $opts -- $cmdline 2>/dev/null or return # If no subcommand has been given, return so this can be used as a condition. diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index 356cebf03..b667c5464 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -20,14 +20,14 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' # vte-based terms set $TERM = xterm*, but only gained support relatively recently. # From https://bugzilla.gnome.org/show_bug.cgi?id=720821, it appears it was version 0.40.0 if set -q VTE_VERSION - and test "$VTE_VERSION" -lt 4000 ^/dev/null + and test "$VTE_VERSION" -lt 4000 2>/dev/null return end # We use the `tput` here just to see if terminfo thinks we can change the cursor. # We cannot use that sequence directly as it's not the correct one for konsole and iTerm, # and because we may want to change the cursor even though terminfo says we can't (tmux). - if not tput Ss >/dev/null ^/dev/null + if not tput Ss >/dev/null 2>/dev/null # Whitelist tmux... and not begin set -q TMUX @@ -57,7 +57,7 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' or set -q ITERM_PROFILE or set -q VTE_VERSION # which version is already checked above # If $XTERM_VERSION is undefined, this will return 1 and print an error. Silence it. - or test (string replace -r "XTerm\((\d+)\)" '$1' -- $XTERM_VERSION) -ge 280 ^/dev/null + or test (string replace -r "XTerm\((\d+)\)" '$1' -- $XTERM_VERSION) -ge 280 2>/dev/null end end diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 6a65f33d7..e281e74a1 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -186,7 +186,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' bind gU upcase-word bind J end-of-line delete-char - bind K 'man (commandline -t) ^/dev/null; or echo -n \a' + bind K 'man (commandline -t) 2>/dev/null; or echo -n \a' bind yy kill-whole-line yank bind Y kill-whole-line yank diff --git a/share/functions/ls.fish b/share/functions/ls.fish index 003fc20c0..79c20237e 100644 --- a/share/functions/ls.fish +++ b/share/functions/ls.fish @@ -1,7 +1,7 @@ # # Make ls use colors if we are on a system that supports that feature and writing to stdout. # -if command ls --version >/dev/null ^/dev/null +if command ls --version >/dev/null 2>/dev/null # This appears to be GNU ls. function ls --description "List contents of directory" set -l param --color=auto @@ -29,7 +29,7 @@ if command ls --version >/dev/null ^/dev/null end end end -else if command ls -G / >/dev/null ^/dev/null +else if command ls -G / >/dev/null 2>/dev/null # It looks like BSD, OS X and a few more which support colors through the -G switch instead. function ls --description "List contents of directory" command ls -G $argv diff --git a/share/functions/nextd.fish b/share/functions/nextd.fish index 366cdd7c0..3d3d3cdfb 100644 --- a/share/functions/nextd.fish +++ b/share/functions/nextd.fish @@ -10,7 +10,7 @@ function nextd --description "Move forward in the directory history" set -l times 1 if set -q argv[1] - if test $argv[1] -ge 0 ^/dev/null + if test $argv[1] -ge 0 2>/dev/null set times $argv[1] else printf (_ "%s: The number of positions to skip must be a non-negative integer\n") nextd diff --git a/share/functions/prevd.fish b/share/functions/prevd.fish index 1d02036ea..acb119705 100644 --- a/share/functions/prevd.fish +++ b/share/functions/prevd.fish @@ -10,7 +10,7 @@ function prevd --description "Move back in the directory history" set -l times 1 if set -q argv[1] - if test $argv[1] -ge 0 ^/dev/null + if test $argv[1] -ge 0 2>/dev/null set times $argv[1] else printf (_ "%s: The number of positions to skip must be a non-negative integer\n") nextd diff --git a/share/functions/psub.fish b/share/functions/psub.fish index 61d8cf4cc..b764d6f35 100644 --- a/share/functions/psub.fish +++ b/share/functions/psub.fish @@ -50,7 +50,7 @@ function psub --description "Read from stdin into a file and output the filename # Find unique function name while true set funcname __fish_psub_(random) - if not functions $funcname >/dev/null ^/dev/null + if not functions $funcname >/dev/null 2>/dev/null break end end