aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions/pacman.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-08-05 17:43:15 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-08-05 17:43:15 +0200
commit33d062cb60a66d9f03dde1e69db37e1cd864f854 (patch)
tree4d88adc3f98abe7de2b1f3ec1b5fea4bdd9b4241 /share/completions/pacman.fish
parent53bcd4b1ab73770b2cd1a5fe27aa2dd3314794bc (diff)
pacman completion: Offer "command-options" first
Diffstat (limited to 'share/completions/pacman.fish')
-rw-r--r--share/completions/pacman.fish24
1 files changed, 14 insertions, 10 deletions
diff --git a/share/completions/pacman.fish b/share/completions/pacman.fish
index 7b789e15..f96cdcbf 100644
--- a/share/completions/pacman.fish
+++ b/share/completions/pacman.fish
@@ -24,6 +24,9 @@ set -l argument 'not expr -- (commandline --current-token) : "^-.*" > /dev/null'
complete -c pacman -e
complete -c pacman -f
+# HACK: We only need these two to coerce fish to stop file completion and complete options
+complete -c $progname -n $noopt -a "-D" -d "Modify the package database"
+complete -c $progname -n $noopt -a "-Q" -d "Query the package database"
# Primary operations
complete -c $progname -s D -f -l database -n $noopt -d 'Modify the package database'
complete -c $progname -s Q -f -l query -n $noopt -d 'Query the package database'
@@ -35,16 +38,17 @@ complete -c $progname -s V -f -l version -d 'Display version and exit'
complete -c $progname -s h -f -l help -d 'Display help'
# General options
-complete -c $progname -s b -l dbpath -d 'Alternative database location' -xa '(__fish_complete_directories)'
-complete -c $progname -s r -l root -d 'Alternative installation root'
-complete -c $progname -s v -l verbose -d 'Output more status messages'
-complete -c $progname -l arch -d 'Alternate architecture' -f
-complete -c $progname -l cachedir -d 'Alternative package cache location'
-complete -c $progname -l config -d 'Alternate config file'
-complete -c $progname -l debug -d 'Display debug messages' -f
-complete -c $progname -l gpgdir -d 'GPG directory to verify signatures'
-complete -c $progname -l logfile -d 'Specify alternative log file'
-complete -c $progname -l noconfirm -d 'Bypass any question' -f
+# Only offer these once a command has been given so they get prominent display
+complete -c $progname -n "not $noopt" -s b -l dbpath -d 'Alternative database location' -xa '(__fish_complete_directories)'
+complete -c $progname -n "not $noopt" -s r -l root -d 'Alternative installation root'
+complete -c $progname -n "not $noopt" -s v -l verbose -d 'Output more status messages'
+complete -c $progname -n "not $noopt" -l arch -d 'Alternate architecture' -f
+complete -c $progname -n "not $noopt" -l cachedir -d 'Alternative package cache location'
+complete -c $progname -n "not $noopt" -l config -d 'Alternate config file'
+complete -c $progname -n "not $noopt" -l debug -d 'Display debug messages' -f
+complete -c $progname -n "not $noopt" -l gpgdir -d 'GPG directory to verify signatures'
+complete -c $progname -n "not $noopt" -l logfile -d 'Specify alternative log file'
+complete -c $progname -n "not $noopt" -l noconfirm -d 'Bypass any question' -f
# Transaction options (sync, remove, upgrade)
for condition in sync remove upgrade