Merge pull request #214 from ylectric/fish-completion

📺 Add completions for fish shell
This commit is contained in:
Ben Chatelain 2019-03-04 19:22:16 -07:00 committed by GitHub
commit 7c3951e7d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 0 deletions

View file

@ -33,6 +33,7 @@ class Mas < Formula
system "script/install", prefix
bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
fish_completion.install "contrib/completion/mas.fish"
end
test do

View file

@ -30,6 +30,7 @@ class Mas < Formula
system "script/install", prefix
bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
fish_completion.install "contrib/completion/mas.fish"
end
test do

View file

@ -0,0 +1,45 @@
# fish completions for mas
### account
complete -c mas -n "__fish_use_subcommand" -f -a account -d "Prints the primary account Apple ID"
### help
complete -c mas -n "__fish_use_subcommand" -f -a help -d "Display general or command-specific help"
### home
complete -c mas -n "__fish_use_subcommand" -f -a home -d "Opens MAS Preview app page in a browser"
### info
complete -c mas -n "__fish_use_subcommand" -f -a info -d "Display app information from the Mac App Store"
### install
complete -c mas -n "__fish_use_subcommand" -f -a install -d "Install from the Mac App Store"
complete -c mas -n "__fish_seen_subcommand_from install" -l force -d "Force reinstall"
### list
complete -c mas -n "__fish_use_subcommand" -f -a list -d "Lists apps from the Mac App Store which are currently installed"
### lucky
complete -c mas -n "__fish_use_subcommand" -f -a lucky -d "Install the first result from the Mac App Store"
### open
complete -c mas -n "__fish_use_subcommand" -f -a open -d "Opens app page in AppStore.app"
### outdated
complete -c mas -n "__fish_use_subcommand" -f -a outdated -d "Lists pending updates from the Mac App Store"
### reset
complete -c mas -n "__fish_use_subcommand" -f -a reset -d "Resets the Mac App Store"
complete -c mas -n "__fish_seen_subcommand_from reset" -l debug -d "Enable debug mode"
### search
complete -c mas -n "__fish_use_subcommand" -f -a search -d "Search for apps from the Mac App Store"
complete -c mas -n "__fish_seen_subcommand_from search" -l price -d "Show price of found apps"
### signin
complete -c mas -n "__fish_use_subcommand" -f -a signin -d "Sign in to the Mac App Store"
complete -c mas -n "__fish_seen_subcommand_from signin" -l price -d "Complete login with graphical dialog"
### signout
complete -c mas -n "__fish_use_subcommand" -f -a signout -d "Sign out of the Mac App Store"
### uninstall
complete -c mas -n "__fish_use_subcommand" -f -a uninstall -d "Uninstall app installed from the Mac App Store"
complete -c mas -n "__fish_seen_subcommand_from uninstall" -l dry-run -d "Dry run mode"
for line in (command mas list 2>/dev/null)
set app (string split " " -- $line)
complete -c mas -n "__fish_seen_subcommand_from uninstall" -f -a $app[1] -d $app[2]
end
### upgrade
complete -c mas -n "__fish_use_subcommand" -f -a upgrade -d "Upgrade outdated apps from the Mac App Store"
### vendor
complete -c mas -n "__fish_use_subcommand" -f -a vendor -d "Opens vendor's app page in a browser"
### version
complete -c mas -n "__fish_use_subcommand" -f -a version -d "Print version number"