mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
remove sed (and awk) from gentoo-portage completions
This commit is contained in:
committed by
Fabian Homborg
parent
70c80c9d0e
commit
02ae926c8e
@@ -1,4 +1,4 @@
|
|||||||
function __fish_portage_print_repository_names --description 'Print the names of all configured repositories'
|
function __fish_portage_print_repository_names --description 'Print the names of all configured repositories'
|
||||||
# repos.conf may be a file or a directory
|
# repos.conf may be a file or a directory
|
||||||
find /etc/portage/repos.conf -type f -exec sed -ne '/^[[:blank:]]*\[[[:alnum:]_][[:alnum:]_-]*\]/{s!^.*\[\(.*\)\].*$!\1!; /DEFAULT/!p}' '{}' +
|
find /etc/portage/repos.conf -type f -exec cat '{}' + | string replace -r --filter '^\s*\[([[:alnum:]_][[:alnum:]_-]*)\]' '$1' | string match -v -e DEFAULT
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
function __fish_portage_print_repository_paths --description 'Print the paths of all configured repositories'
|
function __fish_portage_print_repository_paths --description 'Print the paths of all configured repositories'
|
||||||
# repos.conf may be a file or a directory
|
# repos.conf may be a file or a directory
|
||||||
find /etc/portage/repos.conf -type f -exec awk 'BEGIN { FS="[[:blank:]]*=[[:blank:]]*" } $1 == "location" { print $2 }' '{}' +
|
find /etc/portage/repos.conf -type f -exec cat '{}' + | string replace -r --filter '^\s*location\s*=\s*(\S+)' '$1'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user