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.
This commit is contained in:
Peter Ammon 2018-04-01 13:42:38 -07:00
parent 95e5af7814
commit 7659554dea
82 changed files with 152 additions and 152 deletions

View File

@ -84,7 +84,7 @@ complete -c ack -l bar -d 'The warning admiral'
# File types # File types
if type ack > /dev/null 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 $type -d "Allow $type file type"
complete -c ack -l no$type -l no-$type -d "Don't allow $type file type" complete -c ack -l no$type -l no-$type -d "Don't allow $type file type"
end end

View File

@ -49,7 +49,7 @@ function __fish_adb_run_command -d 'Runs adb with any -s parameters already give
end end
function __fish_adb_list_packages 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 end

View File

@ -69,7 +69,7 @@ function __fish_apm_list_packages
apm list -b apm list -b
end 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 # Completions for Atom Package Manager
################## ##################

View File

@ -2,7 +2,7 @@
function __fish_complete_apropos function __fish_complete_apropos
if test (commandline -ct) if test (commandline -ct)
set str (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
end end

View File

@ -15,7 +15,7 @@ function __fish_busctl
else else
set mode "--system" set mode "--system"
end end
command busctl $mode $argv --no-legend --no-pager ^/dev/null command busctl $mode $argv --no-legend --no-pager 2>/dev/null
end end
# Only get the arguments to the actual command, skipping all options and arguments to options # Only get the arguments to the actual command, skipping all options and arguments to options

View File

@ -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 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 b -l number-nonblank -d "Number nonblank lines"
complete -c cat -s e -d "Escape non-printing characters except tab" complete -c cat -s e -d "Escape non-printing characters except tab"

View File

@ -10,6 +10,6 @@ complete -x -c chsh -a "(__fish_complete_users)"
# util-linux's chsh also has a "-l"/"--list-shells" option. # 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. # 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" complete -f -c chsh -s l -l list-shells -d "List available shells and exit"
end end

View File

@ -20,4 +20,4 @@ complete -c cower -f -s v -l 'verbose' -d 'Output more'
# Complete with AUR packages: # Complete with AUR packages:
# If the search string is too short, cower prints an annoying message to stderr - ignore that # 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)'

View File

@ -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 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 -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" complete -c cp -l copy-contents -d "Copy contents of special files when recursive"

View File

@ -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 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 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" complete -c date -s I -l iso-8601 -d "Output in ISO 8601 format" -x -a "date hours minutes seconds"

View File

@ -7,7 +7,7 @@ function __fish_dconf_keys
# because it allows us to complete non-incrementally # because it allows us to complete non-incrementally
# i.e. to get the keys directly, without going through # i.e. to get the keys directly, without going through
# `dconf list /`, `dconf list /org/` and so on. # `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 if string match -q "[*]" -- $line
# New directory - just save it for the keys # New directory - just save it for the keys
set dir /(string trim -c "[]" -- $line) set dir /(string trim -c "[]" -- $line)

View File

@ -7,7 +7,7 @@
# #
set -l is_gnu 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 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 __fish_gnu_complete -c df -s i -l inodes -d "List inode information" $is_gnu

View File

@ -1,6 +1,6 @@
# First parameter is the profile name, or 'usage' # 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' complete --command duply --no-files --arguments 'usage' -d 'Get usage help text'
# Second parameter is a duply command # Second parameter is a duply command

View File

@ -19,7 +19,7 @@ function __fish_complete_eselect_action_options
# Alter further php completion # Alter further php completion
if [ (__fish_print_cmd_args_without_options)[2] = 'php' ] 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 return
end 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/' 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' 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
end end

View File

@ -2,7 +2,7 @@
# http://www.fossil-scm.org/ # http://www.fossil-scm.org/
function __fish_fossil function __fish_fossil
command fossil $argv ^/dev/null command fossil $argv 2>/dev/null
end end
function __fish_fossil_needs_command function __fish_fossil_needs_command

View File

@ -6,26 +6,26 @@ function __fish_git_commits
# This allows filtering by subject with the new pager! # This allows filtering by subject with the new pager!
# Because even subject lines can be quite long, # Because even subject lines can be quite long,
# trim them (abbrev'd hash+tab+subject) to 73 characters # 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 end
function __fish_git_recent_commits function __fish_git_recent_commits
# Like __fish_git_commits, but not on all branches and limited to # Like __fish_git_commits, but not on all branches and limited to
# the last 50 commits. Used for fixup, where only the current branch # the last 50 commits. Used for fixup, where only the current branch
# and the latest commits make sense. # 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 end
function __fish_git_branches 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 end
function __fish_git_tags function __fish_git_tags
command git tag --sort=-creatordate ^/dev/null command git tag --sort=-creatordate 2>/dev/null
end end
function __fish_git_dir function __fish_git_dir
command git rev-parse --git-dir ^/dev/null command git rev-parse --git-dir 2>/dev/null
end end
function __fish_git_heads function __fish_git_heads
@ -44,7 +44,7 @@ function __fish_git_refs
end end
function __fish_git_remotes function __fish_git_remotes
command git remote ^/dev/null command git remote 2>/dev/null
end end
function __fish_git_files function __fish_git_files
@ -65,7 +65,7 @@ function __fish_git_files
# to get _all_ kinds of staged files. # to get _all_ kinds of staged files.
# Save the repo root to remove it from the path later. # 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 # Cache the translated descriptions so we don't have to get it
# once per file. # once per file.
@ -288,11 +288,11 @@ function __fish_git_stash_not_using_subcommand
end end
function __fish_git_complete_stashes 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 end
function __fish_git_aliases 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 begin
set -l name (string replace -r '^.*\.' '' -- $key) set -l name (string replace -r '^.*\.' '' -- $key)
printf "%s\t%s\n" $name "Alias for $value" printf "%s\t%s\n" $name "Alias for $value"
@ -345,14 +345,14 @@ function __fish_git_possible_commithash
end end
function __fish_git_reflog 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 end
# general options # general options
complete -f -c git -l help -d 'Display the manual of a git command' 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 -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 '(__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 -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 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' complete -f -c git -n '__fish_git_needs_command' -l man-path -d 'Print the path to the man documentation'

View File

@ -48,7 +48,7 @@ function __cache_or_get_gradle_completion
set -l hashed_pwd (fish_md5 -s $PWD) set -l hashed_pwd (fish_md5 -s $PWD)
set -l gradle_cache_file $XDG_CACHE_HOME/gradle-completions/$hashed_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 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 end
cat $gradle_cache_file cat $gradle_cache_file
end end

View File

@ -8,7 +8,7 @@
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT # https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
function __grunt_print_tasks 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 for t in $tasks
echo $t echo $t
end end

View File

@ -27,11 +27,11 @@ function __fish_complete_gsettings_args
if not set -q cmd[2] if not set -q cmd[2]
# Non-relocatable schemas # 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 # Relocatable schemas require a dconf path, but there is no universal way of
# finding the right paths to suggest here. Just default to '/'. # 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 return 0
end end
@ -42,7 +42,7 @@ function __fish_complete_gsettings_args
set -l schema $cmd[2] set -l schema $cmd[2]
if not set -q cmd[3] if not set -q cmd[3]
gsettings $schemadir list-keys $schema ^/dev/null gsettings $schemadir list-keys $schema 2>/dev/null
return 0 return 0
end end
@ -52,7 +52,7 @@ function __fish_complete_gsettings_args
if not set -q cmd[4] if not set -q cmd[4]
set -l key $cmd[3] 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 -l key_type $range[1]
set -e range[1] set -e range[1]
switch $key_type switch $key_type
@ -64,7 +64,7 @@ function __fish_complete_gsettings_args
case '*' case '*'
# If no sensible suggestions can be made, just use the current value. # 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. # 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 end
return 0 return 0
end end

View File

@ -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 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 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' complete -c head -s q -l quiet -l silent -d 'Never print file names'

View File

@ -68,7 +68,7 @@ function __helm_subcommands -a cmd
end end
function __helm_kube_contexts function __helm_kube_contexts
kubectl config get-contexts -o name ^/dev/null kubectl config get-contexts -o name 2>/dev/null
end end
function __helm_kube_namespaces function __helm_kube_namespaces
@ -76,11 +76,11 @@ function __helm_kube_namespaces
end end
function __helm_releases function __helm_releases
helm ls --short ^/dev/null helm ls --short 2>/dev/null
end end
function __helm_release_completions 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 end
function __helm_release_revisions function __helm_release_revisions

View File

@ -34,7 +34,7 @@ function __fish_hg
if set -l cwd (__fish_hg_get_cwd) if set -l cwd (__fish_hg_get_cwd)
set argv $argv --cwd $cwd set argv $argv --cwd $cwd
end end
command hg $argv ^ /dev/null command hg $argv 2>/dev/null
end end
function __fish_hg_commands function __fish_hg_commands

View File

@ -29,7 +29,7 @@ function __fish_iptables_user_chains
set tablearg "--table=$table" set tablearg "--table=$table"
end end
# This only works as root, so ignore errors # 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 echo $b
end end
end end

View File

@ -17,13 +17,13 @@ end
function __fish_journalctl_field_values function __fish_journalctl_field_values
set -l token (commandline -t | cut -d"=" -f 1) 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 echo $token=$value
end end
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 '(__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 "not __fish_journalctl_is_field" -a '+' -d "OR"
complete -c journalctl -n "__fish_journalctl_is_field" -a '(__fish_journalctl_field_values)' -f -r complete -c journalctl -n "__fish_journalctl_is_field" -a '(__fish_journalctl_field_values)' -f -r

View File

@ -10,7 +10,7 @@ end
complete -c kill -xa '(__fish_complete_pids)' 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 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 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" complete -c kill -s L -l table -d " Print signal names and their corresponding numbers"

View File

@ -21,7 +21,7 @@ end
complete -c killall -xa '(__fish_complete_proc)' 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 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 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' 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'

View File

@ -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" complete -c ls -s 1 -d "List one file per line"
# Test if we are using GNU ls # 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 all -d "Show hidden"
complete -c ls -s A -l almost-all -d "Show hidden except . and .." complete -c ls -s A -l almost-all -d "Show hidden except . and .."
complete -c ls -s F -l classify -d "Append filetype indicator" complete -c ls -s F -l classify -d "Append filetype indicator"

View File

@ -1,7 +1,7 @@
complete -c lua -s e -d 'Execute string' -x complete -c lua -s e -d 'Execute string' -x
# Try the most common lib directories, silencing errors in case they don't exist. # 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 i -d 'Enter interactive mode after executing script'
complete -c lua -s v -d 'Show version' complete -c lua -s v -d 'Show version'
complete -c lua -s h -l help -d 'Print help and exit' complete -c lua -s h -l help -d 'Print help and exit'

View File

@ -1,6 +1,6 @@
# Checks if we are using GNU tools # 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 -l version -d 'Output version'
complete -c mkdir -s m -l mode -d 'Set file mode (as in chmod)' -x 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' complete -c mkdir -s p -l parents -d 'Make parent directories as needed'
@ -14,6 +14,6 @@ else
end end
# Checks if SELinux is installed # 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' complete -c mkdir -l context -s Z -d 'Set SELinux security context of each created directory to the default type'
end end

View File

@ -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 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 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' complete -c mktemp -s q -l quiet -d 'suppress diagnostics about file/dir-creation failure'

View File

@ -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" if test (uname) = "Linux"
complete -c modinfo -a "(__fish_print_modules)" complete -c modinfo -a "(__fish_print_modules)"
complete -c modinfo -l author -s a -d "Print only 'author'" complete -c modinfo -l author -s a -d "Print only 'author'"

View File

@ -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_CWORD (math $COMP_CWORD + 1)
set COMP_LINE $COMP_LINE "" set COMP_LINE $COMP_LINE ""
end end
command npm completion -- $COMP_LINE ^/dev/null command npm completion -- $COMP_LINE 2>/dev/null
end end
end end

View File

@ -27,11 +27,11 @@ end
function __fish_pa_list_ports function __fish_pa_list_ports
# Yes, this is localized # 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 end
function __fish_pa_list_profiles 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 end
# This is needed to filter out loaded modules # This is needed to filter out loaded modules

View File

@ -7,7 +7,7 @@ function __fish_passwd_darwin_infosystem
echo -e "nis\tRemote NIS server" echo -e "nis\tRemote NIS server"
end 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 -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 d -l delete -f -d "Delete user password"
complete -c passwd -s e -l expire -f -d "Immediately obsolete user password" complete -c passwd -s e -l expire -f -d "Immediately obsolete user password"

View File

@ -8,7 +8,7 @@
begin begin
set -l unicode 'commandline | string match -qr -- "-[a-zA-Z]*C[a-zA-Z]*\$"' 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 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)" | sed -e 's,/,::,g; s,\.pm\$,,' | sort -u)"
complete -c perl -s 0 -n $noopt -d 'Specify record separator' complete -c perl -s 0 -n $noopt -d 'Specify record separator'
complete -c perl -s a -n $noopt -d 'Turn on autosplit mode' complete -c perl -s a -n $noopt -d 'Turn on autosplit mode'

View File

@ -1,10 +1,10 @@
function __fish_complete_pg_database 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 end
function __fish_complete_pg_user 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 end
complete -c psql --no-files -a '(__fish_complete_pg_database)' complete -c psql --no-files -a '(__fish_complete_pg_database)'

View File

@ -1,5 +1,5 @@
#Completions for rm #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 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 f -l force -d "Never prompt before removal"
complete -c rm -s i -l interactive -d "Prompt before removal" complete -c rm -s i -l interactive -d "Prompt before removal"

View File

@ -130,6 +130,6 @@ complete -c rsync -d "Remote path" -n "commandline -ct | string match -q '*:*'"
__rsync_remote_target __rsync_remote_target
)( )(
# Get the list of remote files from the specified rsync server. # 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-
) )
" "

View File

@ -5,7 +5,7 @@
# Test if we are using GNU sed # Test if we are using GNU sed
set -l is_gnu 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 # Shared ls switches

View File

@ -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 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 s -l separator -d 'Use STRING to separate numbers'
complete -c seq -s w -l equal-width -d 'Equalize width with leading zeroes' complete -c seq -s w -l equal-width -d 'Equalize width with leading zeroes'

View File

@ -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" complete -c ssh -s A -d "Enables forwarding of the authentication agent"
# TODO: Improve this since /proc/net/arp is not POSIX compliant. # TODO: Improve this since /proc/net/arp is not POSIX compliant.
complete -x -c ssh -s b -d "Interface to transmit from" -a " 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" complete -x -c ssh -s e -d "Escape character" -a "\^ none"

View File

@ -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 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 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' 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'

View File

@ -1,9 +1,9 @@
if type -q -f sysctl if type -q -f sysctl
# Only GNU and BSD sysctl seem to know "-h", so others should exit non-zero # 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 # Print sysctl keys and values, separated by a tab
function __fish_sysctl_values function __fish_sysctl_values
sysctl -a ^/dev/null | string replace -a " = " \t sysctl -a 2>/dev/null | string replace -a " = " \t
end end
complete -c sysctl -a '(__fish_sysctl_values)' -f complete -c sysctl -a '(__fish_sysctl_values)' -f
@ -32,7 +32,7 @@ if type -q -f sysctl
else else
# OSX sysctl # OSX sysctl
function __fish_sysctl_values function __fish_sysctl_values
sysctl -a ^/dev/null | string replace -a ":" \t sysctl -a 2>/dev/null | string replace -a ":" \t
end end
complete -c sysctl -a '(__fish_sysctl_values)' -f complete -c sysctl -a '(__fish_sysctl_values)' -f

View File

@ -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 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 -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' complete -c tail -s F -d 'same as --follow=name --retry'

View File

@ -1,20 +1,20 @@
function __fish_tmux_sessions -d 'available sessions' 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 end
function __fish_tmux_clients -d 'connected clients' 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 end
function __fish_tmux_panes -d 'window panes' function __fish_tmux_panes -d 'window panes'
#fully qualified pane names #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 #panes by themselves
tmux list-panes -F '#P pane' ^/dev/null tmux list-panes -F '#P pane' 2>/dev/null
#windows by themselves #windows by themselves
tmux list-panes -F '#W window' ^/dev/null tmux list-panes -F '#W window' 2>/dev/null
end end
#don't allow dirs in the completion list... #don't allow dirs in the completion list...

View File

@ -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 a -d "Change access time"
complete -c touch -s B -l backward -x -d "Set date back" 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" complete -c touch -s c -l no-create -d "Do not create file"

View File

@ -3,7 +3,7 @@
# #
# Test if we are using GNU tr # 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 -x
complete -c tr -s c -s C -l complement -d 'use the complement of SET1' 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' complete -c tr -s d -l delete -d 'delete characters in SET1, do not translate'

View File

@ -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 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 repeated -d "Only print duplicates"
complete -c uniq -s D -l all-repeated -d "Remove non-duplicate lines" -f -x -a " complete -c uniq -s D -l all-repeated -d "Remove non-duplicate lines" -f -x -a "

View File

@ -1,7 +1,7 @@
# Don't go invoking valgrind unless it is installed # Don't go invoking valgrind unless it is installed
set -l skin tool 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 # In older versions of Valgrind, the skin selection option was
# '--skin' # '--skin'
# But someone decided that it would be fun to change this to # But someone decided that it would be fun to change this to

View File

@ -6,7 +6,7 @@
# Check if vi exists at all ( needed for vi --version ) # Check if vi exists at all ( needed for vi --version )
if type -q vi if type -q vi
# Check if vi is really vim # 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 complete -c vi -w vim
else else
complete -c vi -s s -d 'Suppress all interactive user feedback' complete -c vi -s s -d 'Suppress all interactive user feedback'

View File

@ -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 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 -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'" complete -c which -l skip-alias -d "Ignore option '--read-alias'"

View File

@ -4,7 +4,7 @@ function __fish_complete_lpr_option --description 'Complete lpr option'
case '*=*' case '*=*'
string split -m1 = -- "$optstr" | read -l opt val string split -m1 = -- "$optstr" | read -l opt val
set -l descr 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] if not set -q descr[1]
set descr $l set descr $l
continue continue
@ -17,7 +17,7 @@ function __fish_complete_lpr_option --description 'Complete lpr option'
echo $opt=$l\t$default$descr echo $opt=$l\t$default$descr
end end
case '*' case '*'
lpoptions -l ^/dev/null | string replace -r '(.*)/(.*):.*$' '$1=\t$2' lpoptions -l 2>/dev/null | string replace -r '(.*)/(.*):.*$' '$1=\t$2'
end end

View File

@ -30,7 +30,7 @@ function __fish_complete_man
if test -n "$token" if test -n "$token"
# Do the actual search # Do the actual search
apropos $token ^/dev/null | awk ' apropos $token 2>/dev/null | awk '
BEGIN { FS="[\t ]- "; OFS="\t"; } BEGIN { FS="[\t ]- "; OFS="\t"; }
# BSD/Darwin # BSD/Darwin
/^[^( \t]+\('$section'\)/ { /^[^( \t]+\('$section'\)/ {

View File

@ -1,4 +1,4 @@
function __fish_complete_subcommand_root -d "Run the __fish_complete_subcommand function using a PATH containing /sbin and /usr/sbin" 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 __fish_complete_subcommand $argv
end end

View File

@ -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)" echo -e "volmode\t"(_ "How to expose volumes to OS")" (default, geom, dev, none)"
end end
# User properties; the /dev/null redirection masks the possible "no datasets available" # 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 end

View File

@ -133,11 +133,11 @@ function __fish_config_interactive -d "Initializations that should be performed
# c_m_p.py should work with any python version. # 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' 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 if command -qs python3
python3 $update_args >/dev/null ^/dev/null & python3 $update_args >/dev/null 2>/dev/null &
else if command -qs python2 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 else if command -qs python
python $update_args >/dev/null ^/dev/null & python $update_args >/dev/null 2>/dev/null &
end end
end 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" function __fish_repaint --on-variable fish_color_cwd --description "Event handler, repaints the prompt when fish_color_cwd changes"
if status --is-interactive if status --is-interactive
set -e __fish_prompt_cwd set -e __fish_prompt_cwd
commandline -f repaint ^/dev/null commandline -f repaint 2>/dev/null
end end
end end
function __fish_repaint_root --on-variable fish_color_cwd_root --description "Event handler, repaints the prompt when fish_color_cwd_root changes" 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 if status --is-interactive
set -e __fish_prompt_cwd set -e __fish_prompt_cwd
commandline -f repaint ^/dev/null commandline -f repaint 2>/dev/null
end end
end end
@ -231,13 +231,13 @@ function __fish_config_interactive -d "Initializations that should be performed
set -g fish_bind_mode default set -g fish_bind_mode default
if test "$fish_key_bindings" = fish_default_key_bindings if test "$fish_key_bindings" = fish_default_key_bindings
# Redirect stderr per #1155 # Redirect stderr per #1155
fish_default_key_bindings ^/dev/null fish_default_key_bindings 2>/dev/null
else else
eval $fish_key_bindings ^/dev/null eval $fish_key_bindings 2>/dev/null
end end
# Load user key bindings if they are defined # Load user key bindings if they are defined
if functions --query fish_user_key_bindings >/dev/null if functions --query fish_user_key_bindings >/dev/null
fish_user_key_bindings ^/dev/null fish_user_key_bindings 2>/dev/null
end end
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 # it ships with example handlers for bash and zsh, so we'll follow that format
else if type -p -q pkgfile else if type -p -q pkgfile
function __fish_command_not_found_handler --on-event fish_command_not_found 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 if test $status -eq 0
printf "%s may be found in the following packages:\n" "$argv[1]" printf "%s may be found in the following packages:\n" "$argv[1]"
printf " %s\n" $__packages printf " %s\n" $__packages

View File

@ -3,7 +3,7 @@
# #
function __fish_describe_command -d "Command used to find descriptions for commands" 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, ", "); split($1, names, ", ");
for (name in names) for (name in names)
if (names[name] ~ /^'"$argv"'.* *\([18]\)/ ) { if (names[name] ~ /^'"$argv"'.* *\([18]\)/ ) {

View File

@ -193,7 +193,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
set -l svn_remote set -l svn_remote
# get some config options from git-config # 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 switch $key
case bash.showupstream case bash.showupstream
set show_upstream $value set show_upstream $value
@ -241,7 +241,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
case svn\* case svn\*
# get the upstream from the 'git-svn-id: …' in a commit message # get the upstream from the 'git-svn-id: …' in a commit message
# (git-svn uses essentially the same procedure internally) # (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 if test (count $svn_upstream) -ne 0
echo $svn_upstream[-1] | read -l __ svn_upstream __ echo $svn_upstream[-1] | read -l __ svn_upstream __
set svn_upstream (string replace -r '@.*' '' -- $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 end
# Find how many commits we are ahead/behind our upstream # 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 # calculate the result
if test -n "$verbose" 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" echo "$prefix$___fish_git_prompt_char_upstream_diverged$ahead-$behind"
end end
if test -n "$count" -a -n "$name" 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 end
else if test -n "$informative" else if test -n "$informative"
echo $count | read -l behind ahead echo $count | read -l behind ahead
@ -339,7 +339,7 @@ function __fish_git_prompt --description "Prompt function for Git"
if not command -sq git if not command -sq git
return 1 return 1
end 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" test -n "$repo_info"
or return or return
@ -387,7 +387,7 @@ function __fish_git_prompt --description "Prompt function for Git"
if set -q __fish_git_prompt_showuntrackedfiles if set -q __fish_git_prompt_showuntrackedfiles
set -l config (command git config --bool bash.showUntrackedFiles) set -l config (command git config --bool bash.showUntrackedFiles)
if test "$config" != false 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 set u $___fish_git_prompt_char_untrackedfiles
end end
end end
@ -463,7 +463,7 @@ function __fish_git_prompt_staged --description "__fish_git_prompt helper, tells
set -l staged set -l staged
if test -n "$sha" 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 or set staged $___fish_git_prompt_char_stagedstate
else else
set staged $___fish_git_prompt_char_invalidstate 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 dirty
set -l os 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 set os $status
if test $os -ne 0 if test $os -ne 0
set dirty $___fish_git_prompt_char_dirtystate 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 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 stagedFiles (command git diff --staged --name-status | string match -r \\w)
set -l x (count $changedFiles) set -l x (count $changedFiles)
@ -501,7 +501,7 @@ function __fish_git_prompt_informative_status
set -l info set -l info
# If `math` fails for some reason, assume the state is clean - it's the simpler path # 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" if test -z "$state"
or test "$state" = 0 or test "$state" = 0
set info $___fish_git_prompt_color_cleanstate$___fish_git_prompt_char_cleanstate$___fish_git_prompt_color_cleanstate_done 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 set -l os
if test -d $git_dir/rebase-merge if test -d $git_dir/rebase-merge
set branch (cat $git_dir/rebase-merge/head-name ^/dev/null) set branch (cat $git_dir/rebase-merge/head-name 2>/dev/null)
set step (cat $git_dir/rebase-merge/msgnum ^/dev/null) set step (cat $git_dir/rebase-merge/msgnum 2>/dev/null)
set total (cat $git_dir/rebase-merge/end ^/dev/null) set total (cat $git_dir/rebase-merge/end 2>/dev/null)
if test -f $git_dir/rebase-merge/interactive if test -f $git_dir/rebase-merge/interactive
set operation "|REBASE-i" set operation "|REBASE-i"
else else
@ -559,10 +559,10 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
end end
else else
if test -d $git_dir/rebase-apply if test -d $git_dir/rebase-apply
set step (cat $git_dir/rebase-apply/next ^/dev/null) set step (cat $git_dir/rebase-apply/next 2>/dev/null)
set total (cat $git_dir/rebase-apply/last ^/dev/null) set total (cat $git_dir/rebase-apply/last 2>/dev/null)
if test -f $git_dir/rebase-apply/rebasing 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" set operation "|REBASE"
else if test -f $git_dir/rebase-apply/applying else if test -f $git_dir/rebase-apply/applying
set operation "|AM" set operation "|AM"
@ -585,7 +585,7 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
end end
if test -z "$branch" 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 if test $os -ne 0
set detached yes set detached yes
set branch (switch "$__fish_git_prompt_describe_style" 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 command git describe HEAD
case default '*' case default '*'
command git describe --tags --exact-match HEAD 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 if test $os -ne 0
# Shorten the sha ourselves to 8 characters - this should be good for most repositories, # 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 # 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
end end
commandline -f repaint ^/dev/null commandline -f repaint 2>/dev/null
end end
end end
@ -771,7 +771,7 @@ function __fish_git_prompt_repaint_color $varargs --description "Event handler,
set -e ___fish_git_prompt_color_{$name}_done set -e ___fish_git_prompt_color_{$name}_done
end end
end end
commandline -f repaint ^/dev/null commandline -f repaint 2>/dev/null
end end
end end
@ -782,6 +782,6 @@ end
function __fish_git_prompt_repaint_char $varargs --description "Event handler, repaints prompt when any char changes" function __fish_git_prompt_repaint_char $varargs --description "Event handler, repaints prompt when any char changes"
if status --is-interactive if status --is-interactive
set -e _$argv[3] set -e _$argv[3]
commandline -f repaint ^/dev/null commandline -f repaint 2>/dev/null
end end
end end

View File

@ -45,8 +45,8 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
end end
# Read branch and bookmark # Read branch and bookmark
set -l branch (cat $root/branch ^/dev/null; or echo default) set -l branch (cat $root/branch 2>/dev/null; or echo default)
if set -l bookmark (cat $root/bookmarks.current ^/dev/null) if set -l bookmark (cat $root/bookmarks.current 2>/dev/null)
set branch "$branch|$bookmark" set branch "$branch|$bookmark"
end end

View File

@ -1,3 +1,3 @@
function __fish_is_git_repository --description 'Check if the current directory is a git repository' 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 end

View File

@ -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 # 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. # testing whether it supports `kill -t`; in which case it is the coreutils `kill` command.
# Darwin doesn't have kill -t or kill -L # Darwin doesn't have kill -t or kill -L
if kill -t ^/dev/null >/dev/null if kill -t 2>/dev/null >/dev/null
or not kill -L ^/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'. # Posix systems print out the name of a signal using 'kill -l SIGNUM'.
complete -c kill -s l --description "List names of available signals" complete -c kill -s l --description "List names of available signals"
for i in (seq 31) for i in (seq 31)

View File

@ -12,11 +12,11 @@ function __fish_man_page
# Try "man first-second" and fall back to "man first" if that doesn't work out. # Try "man first-second" and fall back to "man first" if that doesn't work out.
set -l maincmd (basename $args[1]) set -l maincmd (basename $args[1])
if set -q args[2] if set -q args[2]
man "$maincmd-$args[2]" ^/dev/null man "$maincmd-$args[2]" 2>/dev/null
or man "$maincmd" ^/dev/null or man "$maincmd" 2>/dev/null
or printf \a or printf \a
else else
man "$maincmd" ^/dev/null man "$maincmd" 2>/dev/null
or printf \a or printf \a
end end

View File

@ -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 *\$" if commandline -j | string match -q -r -v "$cmd *\$"
commandline -aj " ^&1 | $cmd;" commandline -aj " 2>&1 | $cmd;"
end end
end end

View File

@ -1,3 +1,3 @@
function __fish_portage_print_available_categories --description 'Print all available categories' 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 end

View File

@ -43,9 +43,9 @@ function __fish_print_help --description "Print help message for the specified f
set mfish -mfish set mfish -mfish
end end
if test -e "$__fish_data_dir/man/man1/$item.1" 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" 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 end
# The original implementation trimmed off the top 5 lines and bottom 3 lines # The original implementation trimmed off the top 5 lines and bottom 3 lines

View File

@ -1,4 +1,4 @@
function __fish_print_lpr_options --description 'Print lpr options' 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 end

View File

@ -1,5 +1,5 @@
function __fish_print_lpr_printers --description 'Print lpr printers' 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 end

View File

@ -17,7 +17,7 @@ function __fish_print_make_targets --argument-names directory file
end end
set -l bsd_make 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 set bsd_make 0
else else
set bsd_make 1 set bsd_make 1
@ -25,9 +25,9 @@ function __fish_print_make_targets --argument-names directory file
if test "$bsd_make" = 0 if test "$bsd_make" = 0
# https://stackoverflow.com/a/26339924 # 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 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
end end

View File

@ -1,4 +1,4 @@
# Helper function for completions that need to enumerate Linux modules # Helper function for completions that need to enumerate Linux modules
function __fish_print_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 end

View File

@ -21,7 +21,7 @@ function __fish_print_packages
if type -q -f apt-cache if type -q -f apt-cache
# Do not generate the cache as apparently sometimes this is slow. # Do not generate the cache as apparently sometimes this is slow.
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550 # 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 return
end end

View File

@ -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 # For the `service` command, this needs to be without the type suffix
# on Debian at least # on Debian at least
__fish_systemctl_services | string replace -r '.service$' '' __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 command rc-service -l
else if test -d /etc/init.d # SysV on Debian and other linuxen else if test -d /etc/init.d # SysV on Debian and other linuxen
string replace '/etc/init.d/' '' -- /etc/init.d/* string replace '/etc/init.d/' '' -- /etc/init.d/*

View File

@ -1,3 +1,3 @@
function __fish_print_xdg_mimetypes --description 'Print XDG mime types' 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 end

View File

@ -96,7 +96,7 @@ function __fish_svn_prompt --description "Prompt function for svn"
end end
# make sure that this is a svn repo # 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 ] if [ $status -ne 0 ]
return return

View File

@ -1,13 +1,13 @@
function __fish_systemctl_services function __fish_systemctl_services
if type -q systemctl if type -q systemctl
if __fish_contains_opt user if __fish_contains_opt user
systemctl --user list-unit-files --no-legend --type=service ^/dev/null $argv | 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 ^/dev/null | cut -f 1 -d ' ' systemctl --user list-units --state=loaded --no-legend --type=service 2>/dev/null | cut -f 1 -d ' '
else else
# list-unit-files will also show disabled units # 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) # 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 end
end end

View File

@ -26,14 +26,14 @@ function __terlar_git_prompt --description 'Write out the git prompt'
if not command -sq git if not command -sq git
return 1 return 1
end 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 if test -z $branch
return return
end end
echo -n '|' 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" if test -z "$index"
set_color $fish_color_git_clean set_color $fish_color_git_clean

View File

@ -15,7 +15,7 @@ function _fish_systemctl --description 'Call systemctl with some options from th
set -l args $argv set -l args $argv
set -l cmdline (commandline -opc) (commandline -ct) set -l cmdline (commandline -opc) (commandline -ct)
set -e cmdline[1] set -e cmdline[1]
argparse $opts -- $cmdline ^/dev/null argparse $opts -- $cmdline 2>/dev/null
or return or return
# If no subcommand has been given, return so this can be used as a condition. # If no subcommand has been given, return so this can be used as a condition.

View File

@ -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. # 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 # From https://bugzilla.gnome.org/show_bug.cgi?id=720821, it appears it was version 0.40.0
if set -q VTE_VERSION if set -q VTE_VERSION
and test "$VTE_VERSION" -lt 4000 ^/dev/null and test "$VTE_VERSION" -lt 4000 2>/dev/null
return return
end end
# We use the `tput` here just to see if terminfo thinks we can change the cursor. # 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, # 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). # 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... # Whitelist tmux...
and not begin and not begin
set -q TMUX 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 ITERM_PROFILE
or set -q VTE_VERSION # which version is already checked above 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. # 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
end end

View File

@ -186,7 +186,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
bind gU upcase-word bind gU upcase-word
bind J end-of-line delete-char 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 yy kill-whole-line yank
bind Y kill-whole-line yank bind Y kill-whole-line yank

View File

@ -1,7 +1,7 @@
# #
# Make ls use colors if we are on a system that supports that feature and writing to stdout. # 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. # This appears to be GNU ls.
function ls --description "List contents of directory" function ls --description "List contents of directory"
set -l param --color=auto set -l param --color=auto
@ -29,7 +29,7 @@ if command ls --version >/dev/null ^/dev/null
end end
end 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. # 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" function ls --description "List contents of directory"
command ls -G $argv command ls -G $argv

View File

@ -10,7 +10,7 @@ function nextd --description "Move forward in the directory history"
set -l times 1 set -l times 1
if set -q argv[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] set times $argv[1]
else else
printf (_ "%s: The number of positions to skip must be a non-negative integer\n") nextd printf (_ "%s: The number of positions to skip must be a non-negative integer\n") nextd

View File

@ -10,7 +10,7 @@ function prevd --description "Move back in the directory history"
set -l times 1 set -l times 1
if set -q argv[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] set times $argv[1]
else else
printf (_ "%s: The number of positions to skip must be a non-negative integer\n") nextd printf (_ "%s: The number of positions to skip must be a non-negative integer\n") nextd

View File

@ -50,7 +50,7 @@ function psub --description "Read from stdin into a file and output the filename
# Find unique function name # Find unique function name
while true while true
set funcname __fish_psub_(random) set funcname __fish_psub_(random)
if not functions $funcname >/dev/null ^/dev/null if not functions $funcname >/dev/null 2>/dev/null
break break
end end
end end