fix 'grep ... | sed'

This commit is contained in:
Wilke Schwiedop 2018-03-26 19:49:02 +02:00 committed by Fabian Homborg
parent bd24e8662e
commit 8ae9b716a0
4 changed files with 10 additions and 17 deletions

View file

@ -23,10 +23,9 @@ complete -c lpadmin -s o -d 'Sets the binary communications program to use when
complete -c lpadmin -s o -d 'Sets the error policy to be used when the printer backend is unable to send the job to the printer. ' -xa 'printer-error-policy=abort-job printer-error-policy=retry-job printer-error-policy=retry-current-job printer-error-policy=stop-printer'
complete -c lpadmin -s o -xa printer-is-shared=true -d 'Sets the destination to shared/published or unshared/unpublished'
complete -c lpadmin -s o -xa printer-is-shared=false -d 'Sets the destination to shared/published or unshared/unpublished'
complete -c lpadmin -s o -d 'Sets the IPP operation policy associated with the destination' -xa "printer-policy=(cat /etc/cups/cupsd.conf | grep \<Policy | sed 's/<Policy \(.\+\)>/\1/')"
complete -c lpadmin -s o -d 'Sets the IPP operation policy associated with the destination' -xa "printer-policy=(string replace -r --filter '<Policy (.*)>' '$1' < /etc/cups/cupsd.conf)"
complete -c lpadmin -s u -xa 'allow:all allow:none (__fish_complete_list , __fish_complete_users allow:)' -d 'Sets user-level access control on a destination. Names starting with "@" are interpreted as UNIX group'
complete -c lpadmin -s u -xa '(__fish_complete_list , __fish_complete_groups allow: @)' -d 'Sets user-level access control on a destination. Names starting with "@" are interpreted as UNIX group'
complete -c lpadmin -s u -xa 'deny:all deny:none (__fish_complete_list , __fish_complete_users deny:)' -d 'Sets user-level access control on a destination. Names starting with "@" are interpreted as UNIX group'
complete -c lpadmin -s u -xa '(__fish_complete_list , __fish_complete_groups deny: @)' -d 'Sets user-level access control on a destination. Names starting with "@" are interpreted as UNIX group'

View file

@ -63,21 +63,18 @@ complete -c mvn -f -o V -l show-version -d "Display version
complete -c mvn -f -o v -l version -d "Display version information"
complete -c mvn -f -o X -l debug -d "Produce execution debug output"
#
#
# Profiles
#
#
function __fish_mvn_profiles_from_settings
grep -e "<profile>" -A 1 ~/.m2/settings.xml | grep -e "<id>.*</id>" | sed 's/.*<id>//' | sed 's/<\/id>.*//g'
end
#TODO search pom.xml hierarchy
function __fish_mvn_profiles_from_pom
[ -e pom.xml ]; and grep -e "<profile>" -A 1 pom.xml | grep -e "<id>.*</id>" | sed 's/.*<id>//' | sed 's/<\/id>.*//g'
function __fish_mvn_profiles
# find line opening the profile-tag
# read next line
# extract contents of id-tag
sed -n -e '/<profile>/{n; s!^.*<id>\([^<]*\)</id>.*$!\1!; p}' ~/.m2/settings.xml pom.xml ^/dev/null
end
complete -c mvn -f -r -o P -l activate-profiles -a "(__fish_mvn_profiles_from_pom) (__fish_mvn_profiles_from_settings)" -d "Comma-delimited list of profiles to activate"
complete -c mvn -f -r -o P -l activate-profiles -a "(__fish_mvn_profiles)" -d "Comma-delimited list of profiles to activate"
#default properties for some plugins / profiles

View file

@ -5,12 +5,10 @@ function __fish_complete_convert_options --description 'Complete Convert options
case color Color
convert -list color | awk '{ print $1"\t"$2" "$3} ' | sed '1,/----/d'
case family
convert -list Font | grep family | sed 's/^\s*.\+: //' | sort -u
convert -list Font | sed '/family/!d; s/^\s*.\+: //' | sort -u
case font Font
convert -list Font | grep Font | sed 's/^\s*.\+: //' | sort -u
convert -list Font | sed '/Font/!d; s/^\s*.\+: //' | sort -u
case '*'
convert -list $what
end
end

View file

@ -1,4 +1,3 @@
function __fish_print_xwindows --description 'Print X windows'
xwininfo -root -children | grep '^\s\+0x' | sed '/(has no name)/d; s/^\s*\(\S\+\)\s\+"\(.\+\)":\s\+(\(.*\)).*$/\1\t\2 (\3)/'
xwininfo -root -children | sed '/^\s\+0x/!d; /(has no name)/d; s/^\s*\(\S\+\)\s\+"\(.\+\)":\s\+(\(.*\)).*$/\1\t\2 (\3)/'
end