2017-12-21 23:43:21 +08:00
#
# Completions for the eopkg command
#
# Frequently used eopkg commands
# Eopkg subcommand
function __fish_eopkg_subcommand -a subcommand
set -e argv [ 1 ]
complete -f -c eopkg -n '__fish_use_subcommand' -a $subcommand $argv
end
function __fish_eopkg_subcommand_with_shortcut -a subcommand shortcut
set -e argv [ 1 .. 2 ]
complete -f -c eopkg -n '__fish_use_subcommand' -a $subcommand $argv
complete -f -c eopkg -n '__fish_use_subcommand' -a $shortcut $argv
end
# Eopkg subcommand's option
2018-01-23 06:25:34 +08:00
function __fish_eopkg_option -a subcommand
2017-12-21 23:43:21 +08:00
set -e argv [ 1 ]
complete -f -c eopkg -n " __fish_seen_subcommand_from $subcommand " $argv
end
2018-01-23 06:25:34 +08:00
function __fish_eopkg_option_with_shortcut -a subcommand shortcut
set -e argv [ 1 .. 2 ]
2017-12-21 23:43:21 +08:00
complete -f -c eopkg -n " __fish_seen_subcommand_from $subcommand " $argv
complete -f -c eopkg -n " __fish_seen_subcommand_from $shortcut " $argv
end
# Print additional completion
function __fish_eopkg_print_components -d "Print list of components"
eopkg list-components -N | string replace -r ' .*' ''
end
function __fish_eopkg_print_repos -d "Print list of repositories"
eopkg list-repo -N | string match -e active | string replace -r ' .*' ''
end
# Setup additional completion
2018-01-23 06:25:34 +08:00
complete -f -c eopkg -n '__fish_seen_subcommand_from remove-repo rr enable-repo er disable-repo dr list-available la' -a "(__fish_eopkg_print_repos)" -d "Repository"
2018-07-10 14:21:44 +08:00
complete -f -c eopkg -n '__fish_seen_subcommand_from upgrade up install it info' -a "(__fish_print_packages)" -d "Available Package"
complete -f -c eopkg -n '__fish_seen_subcommand_from remove rm autoremove rmf check' -a "(__fish_print_packages --installed)" -d "Installed Package"
2018-01-23 06:25:34 +08:00
complete -f -c eopkg -n '__fish_seen_subcommand_from upgrade up remove rm install it info check list-available la list-installed li list-upgrades lu' -s c -l component -a "(__fish_eopkg_print_components)" -d "Component"
2017-12-21 23:43:21 +08:00
# Setup eopkg subcommand with shortcut
2018-01-23 06:25:34 +08:00
## Upgrade
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut upgrade up -d "Upgrades packages"
__fish_eopkg_option_with_shortcut upgrade up -l security-only -d "Security related upgrades only"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut upgrade up -s c -l component -x -d "Upgrade component's and recursive components' packages"
2017-12-21 23:43:21 +08:00
__fish_eopkg_option_with_shortcut upgrade up -s n -l dry-run -d "Show what would be done"
2018-01-23 06:25:34 +08:00
## Install
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut install it -d "Install packages"
__fish_eopkg_option_with_shortcut install it -l reinstall -d "Reinstall already installed packages"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut install it -s c -l component -x -d "Install component's and recursive components' packages"
2017-12-21 23:43:21 +08:00
__fish_eopkg_option_with_shortcut install it -s n -l dry-run -d "Show what would be done"
2018-01-23 06:25:34 +08:00
## Remove
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut remove rm -d "Remove packages"
__fish_eopkg_option_with_shortcut remove rm -l purge -d "Removes everything including changed config files of the package"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut remove rm -s c -l component -x -d "Remove component's and recursive components' packages"
2017-12-21 23:43:21 +08:00
__fish_eopkg_option_with_shortcut remove rm -s n -l dry-run -d "Show what would be done"
2018-01-23 06:25:34 +08:00
## Remove Orphans
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut remove-orphans rmo -d "Remove orphaned packages"
__fish_eopkg_option_with_shortcut remove-orphans rmo -l purge -d "Remove everything including changed config files of the package"
__fish_eopkg_option_with_shortcut remove-orphans rmo -s n -l dry-run -d "Show what would be done"
2018-01-23 06:25:34 +08:00
## Autoremove
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut autoremove rmf -d "Remove packages and dependencies"
__fish_eopkg_option_with_shortcut autoremove rmf -l purge -d "Remove everything including changed config files of the package"
__fish_eopkg_option_with_shortcut autoremove rmf -s n -l dry-run -d "Show what would be done"
2018-01-23 06:25:34 +08:00
## History
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut history hs -d "History of operations"
__fish_eopkg_option_with_shortcut history hs -s l -l last -x -d "Output only the last n operations"
__fish_eopkg_option_with_shortcut history hs -s t -l takeback -x -d "Takeback to the state after the given operation"
2018-01-23 06:25:34 +08:00
## Search
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut search sr -d "Search packages"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut search sr -l description -d "Search in package name"
2017-12-21 23:43:21 +08:00
__fish_eopkg_option_with_shortcut search sr -l name -d "Search in package name"
__fish_eopkg_option_with_shortcut search sr -l summary -d "Search in package name"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut search sr -s i -l installdb -d "Search only installed package"
__fish_eopkg_option_with_shortcut search sr -s r -l repository -x -d "Name of the source or package repository"
complete -f -c eopkg -n '__fish_seen_subcommand_from search sr' -s r -l repository -a "(__fish_eopkg_print_repos)" -d "Repository"
2017-12-21 23:43:21 +08:00
2018-01-23 06:25:34 +08:00
## Search File
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut search-file sf -d "Search for a file in installed packages"
__fish_eopkg_option_with_shortcut search-file sf -s l -l long -d "Show in long format"
__fish_eopkg_option_with_shortcut search-file sf -s q -l quiet -d "Show only package name"
2018-01-23 06:25:34 +08:00
## Repo Management
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut add-repo ar -r -d "Add a repository"
__fish_eopkg_subcommand_with_shortcut disable-repo dr -x -d "Disable repositories"
2018-01-23 06:25:34 +08:00
__fish_eopkg_subcommand_with_shortcut enable-repo er -x -d "Enable repositories"
__fish_eopkg_subcommand_with_shortcut remove-repo rr -x -d "Remove repositories"
2017-12-21 23:43:21 +08:00
2018-01-23 06:25:34 +08:00
## List Available
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut list-available la -d "List available packages in the repositories"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut list-available la -s c -l component -x -d "List available package under given component"
__fish_eopkg_option_with_shortcut list-available la -s l -l long -d "Show in long format"
__fish_eopkg_option_with_shortcut list-available la -s U -l uninstalled -d "Show only uninstalled packages"
## List Components
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut list-components lc -d "List available components"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut list-components lc -s l -l long -d "Show in long format"
## List Installed
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut list-installed li -d "List of all installed packages"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut list-installed li -s a -l automatic -d "Show automatically installed packages and the parent dependency"
__fish_eopkg_option_with_shortcut list-installed li -s c -l component -x -d "List installed packages under given component"
__fish_eopkg_option_with_shortcut list-installed li -s i -l install-info -d "Show detailed install info"
__fish_eopkg_option_with_shortcut list-installed li -s l -l long -d "Show in long format"
## List Upgrades
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut list-upgrades lu -d "List packages to be upgraded"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option_with_shortcut list-upgrades lu -s c -l component -x -d "List upgradable packages under given component"
__fish_eopkg_option_with_shortcut list-upgrades lu -s i -l install-info -d "Show detailed install info"
__fish_eopkg_option_with_shortcut list-upgrades lu -s l -l long -d "Show in long format"
## Other
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand_with_shortcut list-repo lr -d "List repositories"
__fish_eopkg_subcommand_with_shortcut rebuild-db rdb -d "Rebuild the eopkg database"
# Setup eopkg subcommand
2018-01-23 06:25:34 +08:00
## Check
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand check -d "Verify packages installation"
__fish_eopkg_option check -l config -d "Checks only changed config files of the packages"
__fish_eopkg_option check -s c -l component -x -d "Check installed packages under given component"
2018-01-23 06:25:34 +08:00
## Info
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand info -d "Display package information"
__fish_eopkg_option info -l xml -d "Output in xml format"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option info -s c -l component -f -d "Info about given component"
2017-12-21 23:43:21 +08:00
__fish_eopkg_option info -s f -l files -d "Show a list of package files"
__fish_eopkg_option info -s F -l files-path -d "Show only paths"
2018-01-23 06:25:34 +08:00
__fish_eopkg_option info -s s -l short -d "Do not show details"
2017-12-21 23:43:21 +08:00
2018-01-23 06:25:34 +08:00
## Help
2017-12-21 23:43:21 +08:00
__fish_eopkg_subcommand help -d "Prints help for given command"
# Setup eopkg general option
2018-01-23 06:25:34 +08:00
complete -c eopkg -l version -d "Show program's version number and exit"
2017-12-21 23:43:21 +08:00
complete -c eopkg -s d -l debug -d "Show debugging information"
2018-01-23 06:25:34 +08:00
complete -c eopkg -s D -l destdir -r -d "Change the system root for eopkg commands"
2017-12-21 23:43:21 +08:00
complete -c eopkg -s h -l help -d "Show help message and exit"
2018-01-23 06:25:34 +08:00
complete -c eopkg -s L -l bandwidth-limit -x -d "Keep bandwidth usage under specified KB's"
complete -c eopkg -s p -l password -x
complete -c eopkg -s u -l username -x
complete -c eopkg -s v -l verbose -d "Detailed output"
complete -c eopkg -s y -l yes-all -d "Assume yes for all yes/no queries"