2019-01-29 22:20:16 +00:00
# fish completions for mas
2019-05-23 16:08:40 +00:00
function __fish_mas_list_available -d "Lists applications available to install from the Mac App Store"
set query ( commandline -ct )
if set results ( command mas search $query 2 > /dev/null)
for res in $results
echo $res
end | string trim --left | string replace -r '\s+' '\t'
end
end
function __fish_mas_list_installed -d "Lists installed applications from the Mac App Store"
command mas list 2 > /dev/null \
| string replace -r '\s+' '\t'
end
function __fish_mas_outdated_installed -d "Lists outdated installed applications from the Mac App Store"
command mas outdated 2 > /dev/null \
| string replace -r '\s+' '\t'
end
# no file completions in mas
complete -c mas -f
2019-01-29 22:20:16 +00:00
### account
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a account -d "Display the Apple ID signed in in the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "account"
2019-01-29 22:20:16 +00:00
### help
complete -c mas -n "__fish_use_subcommand" -f -a help -d "Display general or command-specific help"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "help"
2019-01-29 22:20:16 +00:00
### home
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a home -d "Open app's Mac App Store web page in the default web browser"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "home"
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_seen_subcommand_from home info install open purchase vendor" -xa "(__fish_mas_list_available)"
2019-01-29 22:20:16 +00:00
### info
complete -c mas -n "__fish_use_subcommand" -f -a info -d "Display app information from the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "info"
2019-01-29 22:20:16 +00:00
### install
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a install -d "Install previously purchased app(s) from the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "install"
complete -c mas -n "__fish_seen_subcommand_from install lucky" -l force -d "Force reinstall"
2019-01-29 22:20:16 +00:00
### list
2024-10-28 05:00:48 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a list -d "List apps installed from the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "list"
2019-01-29 22:20:16 +00:00
### lucky
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a lucky -d "Install the first app returned from searching the Mac App Store (app must have been previously purchased)"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "lucky"
2019-01-29 22:20:16 +00:00
### open
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a open -d "Open app page in 'App Store.app'"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "open"
2019-01-29 22:20:16 +00:00
### outdated
2024-10-28 05:00:48 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a outdated -d "List pending app updates from the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "outdated"
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_seen_subcommand_from outdated" -l verbose -d "Display warnings about apps unknown to the Mac App Store"
### purchase
complete -c mas -n "__fish_use_subcommand" -f -a purchase -d "\"Purchase\" and install free apps from the Mac App Store"
complete -c mas -n "__fish_seen_subcommand_from help" -xa "purchase"
2019-01-29 22:20:16 +00:00
### reset
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a reset -d "Reset Mac App Store running processes"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "reset"
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_seen_subcommand_from reset" -l debug -d "Output debug information"
2019-01-29 22:20:16 +00:00
### search
complete -c mas -n "__fish_use_subcommand" -f -a search -d "Search for apps from the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "search"
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_seen_subcommand_from search" -l price -d "Display the price of each app"
2019-01-29 22:20:16 +00:00
### signin
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a signin -d "Sign in to an Apple ID in the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "signin"
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_seen_subcommand_from signin" -l dialog -d "Provide password via graphical dialog"
2019-01-29 22:20:16 +00:00
### signout
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a signout -d "Sign out of the Apple ID currently signed in in the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "signout"
2019-01-29 22:20:16 +00:00
### uninstall
2024-10-28 05:00:48 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a uninstall -d "Uninstall app installed from the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "uninstall"
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_seen_subcommand_from uninstall" -l dry-run -d "Perform dry run"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from uninstall" -x -a "(__fish_mas_list_installed)"
2019-01-29 22:20:16 +00:00
### upgrade
2024-10-28 05:00:48 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a upgrade -d "Upgrade outdated app(s) from the Mac App Store"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "upgrade"
complete -c mas -n "__fish_seen_subcommand_from upgrade" -x -a "(__fish_mas_outdated_installed)"
2019-01-29 22:20:16 +00:00
### vendor
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a vendor -d "Open vendor's app web page in the default web browser"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "vendor"
2019-01-29 22:20:16 +00:00
### version
2024-10-26 15:43:08 +00:00
complete -c mas -n "__fish_use_subcommand" -f -a version -d "Display version number"
2019-05-23 16:08:40 +00:00
complete -c mas -n "__fish_seen_subcommand_from help" -xa "version"