fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian Homborg__fish_print_packages: Extract the rest04d7d8902

master
8.2 KiB145 linesraw
1#
2# Completions for eopkg, Solus' package manager
3#
4
5function __fish_eopkg_subcommand -a subcommand
6    set -e argv[1]
7    complete -f -c eopkg -n __fish_use_subcommand -a $subcommand $argv
8end
9
10function __fish_eopkg_subcommand_with_shortcut -a subcommand shortcut
11    set -e argv[1..2]
12    complete -f -c eopkg -n __fish_use_subcommand -a $subcommand $argv
13    complete -f -c eopkg -n __fish_use_subcommand -a $shortcut $argv
14end
15
16function __fish_eopkg_option -a subcommand
17    set -e argv[1]
18    complete -f -c eopkg -n "__fish_seen_subcommand_from $subcommand" $argv
19end
20
21function __fish_eopkg_option_with_shortcut -a subcommand shortcut
22    set -e argv[1..2]
23    complete -f -c eopkg -n "__fish_seen_subcommand_from $subcommand" $argv
24    complete -f -c eopkg -n "__fish_seen_subcommand_from $shortcut" $argv
25end
26
27function __fish_eopkg_print_components -d "Print list of components"
28    eopkg list-components -N | string replace -r ' .*' ''
29end
30
31function __fish_eopkg_print_repos -d "Print list of repositories"
32    eopkg list-repo -N | string match -e active | string replace -r ' .*' ''
33end
34
35complete -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
36complete -f -c eopkg -n '__fish_seen_subcommand_from upgrade up install it info' -a "(__fish_print_eopkg_packages)" -d "Available Package"
37complete -f -c eopkg -n '__fish_seen_subcommand_from remove rm autoremove rmf check' -a "(__fish_print_eopkg_packages --installed)" -d "Installed package"
38complete -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
39
40## Upgrade
41__fish_eopkg_subcommand_with_shortcut upgrade up -d "Upgrades packages"
42__fish_eopkg_option_with_shortcut upgrade up -l security-only -d "Security related upgrades only"
43__fish_eopkg_option_with_shortcut upgrade up -s c -l component -x -d "Upgrade component's and recursive components' packages"
44__fish_eopkg_option_with_shortcut upgrade up -s n -l dry-run -d "Show what would be done"
45
46## Install
47__fish_eopkg_subcommand_with_shortcut install it -d "Install packages"
48__fish_eopkg_option_with_shortcut install it -l reinstall -d "Reinstall already installed packages"
49__fish_eopkg_option_with_shortcut install it -s c -l component -x -d "Install component's and recursive components' packages"
50__fish_eopkg_option_with_shortcut install it -s n -l dry-run -d "Show what would be done"
51
52## Remove
53__fish_eopkg_subcommand_with_shortcut remove rm -d "Remove packages"
54__fish_eopkg_option_with_shortcut remove rm -l purge -d "Removes everything including changed config files of the package"
55__fish_eopkg_option_with_shortcut remove rm -s c -l component -x -d "Remove component's and recursive components' packages"
56__fish_eopkg_option_with_shortcut remove rm -s n -l dry-run -d "Show what would be done"
57
58## Remove Orphans
59__fish_eopkg_subcommand_with_shortcut remove-orphans rmo -d "Remove orphaned packages"
60__fish_eopkg_option_with_shortcut remove-orphans rmo -l purge -d "Remove everything including changed config files of the package"
61__fish_eopkg_option_with_shortcut remove-orphans rmo -s n -l dry-run -d "Show what would be done"
62
63## Autoremove
64__fish_eopkg_subcommand_with_shortcut autoremove rmf -d "Remove packages and dependencies"
65__fish_eopkg_option_with_shortcut autoremove rmf -l purge -d "Remove everything including changed config files of the package"
66__fish_eopkg_option_with_shortcut autoremove rmf -s n -l dry-run -d "Show what would be done"
67
68## History
69__fish_eopkg_subcommand_with_shortcut history hs -d "History of operations"
70__fish_eopkg_option_with_shortcut history hs -s l -l last -x -d "Output only the last n operations"
71__fish_eopkg_option_with_shortcut history hs -s t -l takeback -x -d "Takeback to the state after the given operation"
72
73## Search
74__fish_eopkg_subcommand_with_shortcut search sr -d "Search packages"
75__fish_eopkg_option_with_shortcut search sr -l description -d "Search in package name"
76__fish_eopkg_option_with_shortcut search sr -l name -d "Search in package name"
77__fish_eopkg_option_with_shortcut search sr -l summary -d "Search in package name"
78__fish_eopkg_option_with_shortcut search sr -s i -l installdb -d "Search only installed package"
79__fish_eopkg_option_with_shortcut search sr -s r -l repository -x -d "Name of the source or package repository"
80complete -f -c eopkg -n '__fish_seen_subcommand_from search sr' -s r -l repository -a "(__fish_eopkg_print_repos)" -d Repository
81
82## Search File
83__fish_eopkg_subcommand_with_shortcut search-file sf -d "Search for a file in installed packages"
84__fish_eopkg_option_with_shortcut search-file sf -s l -l long -d "Show in long format"
85__fish_eopkg_option_with_shortcut search-file sf -s q -l quiet -d "Show only package name"
86
87## Repo Management
88__fish_eopkg_subcommand_with_shortcut add-repo ar -r -d "Add a repository"
89__fish_eopkg_subcommand_with_shortcut disable-repo dr -x -d "Disable repositories"
90__fish_eopkg_subcommand_with_shortcut enable-repo er -x -d "Enable repositories"
91__fish_eopkg_subcommand_with_shortcut remove-repo rr -x -d "Remove repositories"
92
93## List Available
94__fish_eopkg_subcommand_with_shortcut list-available la -d "List available packages in the repositories"
95__fish_eopkg_option_with_shortcut list-available la -s c -l component -x -d "List available package under given component"
96__fish_eopkg_option_with_shortcut list-available la -s l -l long -d "Show in long format"
97__fish_eopkg_option_with_shortcut list-available la -s U -l uninstalled -d "Show only uninstalled packages"
98
99## List Components
100__fish_eopkg_subcommand_with_shortcut list-components lc -d "List available components"
101__fish_eopkg_option_with_shortcut list-components lc -s l -l long -d "Show in long format"
102
103## List Installed
104__fish_eopkg_subcommand_with_shortcut list-installed li -d "List of all installed packages"
105__fish_eopkg_option_with_shortcut list-installed li -s a -l automatic -d "Show automatically installed packages and the parent dependency"
106__fish_eopkg_option_with_shortcut list-installed li -s c -l component -x -d "List installed packages under given component"
107__fish_eopkg_option_with_shortcut list-installed li -s i -l install-info -d "Show detailed install info"
108__fish_eopkg_option_with_shortcut list-installed li -s l -l long -d "Show in long format"
109
110## List Upgrades
111__fish_eopkg_subcommand_with_shortcut list-upgrades lu -d "List packages to be upgraded"
112__fish_eopkg_option_with_shortcut list-upgrades lu -s c -l component -x -d "List upgradable packages under given component"
113__fish_eopkg_option_with_shortcut list-upgrades lu -s i -l install-info -d "Show detailed install info"
114__fish_eopkg_option_with_shortcut list-upgrades lu -s l -l long -d "Show in long format"
115
116## Other
117__fish_eopkg_subcommand_with_shortcut list-repo lr -d "List repositories"
118__fish_eopkg_subcommand_with_shortcut rebuild-db rdb -d "Rebuild the eopkg database"
119
120## Check
121__fish_eopkg_subcommand check -d "Verify packages installation"
122__fish_eopkg_option check -l config -d "Checks only changed config files of the packages"
123__fish_eopkg_option check -s c -l component -x -d "Check installed packages under given component"
124
125## Info
126__fish_eopkg_subcommand info -d "Display package information"
127__fish_eopkg_option info -l xml -d "Output in xml format"
128__fish_eopkg_option info -s c -l component -f -d "Info about given component"
129__fish_eopkg_option info -s f -l files -d "Show a list of package files"
130__fish_eopkg_option info -s F -l files-path -d "Show only paths"
131__fish_eopkg_option info -s s -l short -d "Do not show details"
132
133## Help
134__fish_eopkg_subcommand help -d "Prints help for given command"
135
136# General options
137complete -c eopkg -l version -d "Show program's version number and exit"
138complete -c eopkg -s d -l debug -d "Show debugging information"
139complete -c eopkg -s D -l destdir -r -d "Change the system root for eopkg commands"
140complete -c eopkg -s h -l help -d "Show help message and exit"
141complete -c eopkg -s L -l bandwidth-limit -x -d "Keep bandwidth usage under specified KB's"
142complete -c eopkg -s p -l password -x
143complete -c eopkg -s u -l username -x
144complete -c eopkg -s v -l verbose -d "Detailed output"
145complete -c eopkg -s y -l yes-all -d "Assume yes for all yes/no queries"