Replace some uses of tr

This commit is contained in:
Fabian Boehm 2022-07-22 12:20:45 +02:00
parent a6820cbe62
commit a7af4a0307
7 changed files with 7 additions and 10 deletions

View file

@ -1,7 +1,7 @@
complete -c cowsay -s e -d "Specify eye string" -r
complete -c cowsay -s f -d "Specify cow file" -x -a '(cowsay -l|tail -n +2|tr \ \n)'
complete -c cowsay -s f -d "Specify cow file" -x -a '(cowsay -l | tail -n +2 | string split " ")'
complete -c cowsay -s h -d "Display help and exit"
complete -c cowsay -s l -d "List all cowfiles"
complete -c cowsay -s n -d "No word wrapping"

View file

@ -1,7 +1,7 @@
complete -c cowthink -s e -d "Specify eye string" -r
complete -c cowthink -s f -d "Specify cow file" -x -a '(cowthink -l|tail -n +2|tr \ \n)'
complete -c cowthink -s f -d "Specify cow file" -x -a '(cowthink -l | tail -n +2 | string split " ")'
complete -c cowthink -s h -d "Display help and exit"
complete -c cowthink -s l -d "List all cowfiles"
complete -c cowthink -s n -d "No word wrapping"

View file

@ -8,10 +8,7 @@
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
function __grunt_print_tasks
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
grunt --version --verbose 2>/dev/null | awk '/Available tasks: / {$1=$2=""; print $0}' | awk '{$1=$1}1' | string split ' '
end
complete -c grunt -fa '(__grunt_print_tasks)'

View file

@ -1,4 +1,4 @@
complete -c pactree -xa "(pacman -Sl | cut --delim ' ' --fields 2- | tr ' ' \t | sort)"
complete -c pactree -xa "(pacman -Sl | string replace -r '(\S+) *(\S+) *(.*)' '$2\t$3')"
complete -c pactree -s b -l dbpath -d 'Set an alternate database location' -xa '(__fish_complete_directories)'
complete -c pactree -s c -l color -d 'Colorize output'
complete -c pactree -s d -l depth -d 'Limit the depth of recursion' -x

View file

@ -7,6 +7,6 @@ complete -c pkgfile -s r -l regex -d 'allow the use of regex in searches'
complete -c pkgfile -s R -l repo -d 'search only in the specified repository' -xa '(__fish_print_pacman_repos)'
complete -c pkgfile -s v -l verbose -d 'enable verbose output'
complete -c pkgfile -s i -l info -d 'provides information about the package owning a file' -r
complete -c pkgfile -s l -l list -d 'list files of a given package; similar to "pacman -Ql"' -xa "(pacman -Sl | cut --delim ' ' --fields 2- | tr ' ' \t | sort)"
complete -c pkgfile -s l -l list -d 'list files of a given package; similar to "pacman -Ql"' -xa "(pacman -Sl | string replace -r '(\S+) *(\S+) *(.*)' '$2\t$3')"
complete -c pkgfile -s s -l search -d 'search which package owns a file' -r
complete -c pkgfile -s u -l update -d 'update to the latest filelist. This requires write permission to /var/cache/pkgtools/lists'

View file

@ -1,5 +1,5 @@
complete -c rfkill -xa 'block unblock list event help' -n 'not __fish_seen_subcommand_from block unblock list event help'
complete -c rfkill -n '__fish_seen_subcommand_from block unblock list' -d 'device group' -xa "all wifi wlan bluetooth uwb ultrawideband wimax wwan gps fm (rfkill list | tr : \t)"
complete -c rfkill -n '__fish_seen_subcommand_from block unblock list' -d 'device group' -xa "all wifi wlan bluetooth uwb ultrawideband wimax wwan gps fm (rfkill list | string replace : \t)"
complete -c rfkill -s V -l version -d 'Print version'
complete -c rfkill -s h -l help -d 'Print help'
complete -c rfkill -s J -l json -d 'JSON output'

View file

@ -1,5 +1,5 @@
function __fish_print_xdg_desktop_file_ids --description 'Print all available xdg desktop file IDs'
find (__fish_print_xdg_applications_directories) -name \*.desktop \( -type f -or -type l \) -printf '%P\n' | tr / - | sort -u
find (__fish_print_xdg_applications_directories) -name \*.desktop \( -type f -or -type l \) -printf '%P\n' | string replace -a -- / - | path sort -u
end
# main completion