-
Notifications
You must be signed in to change notification settings - Fork 17
Add zsh completion files. #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
VorpalBlade
wants to merge
4
commits into
andrewgregory:master
Choose a base branch
from
VorpalBlade:feature/zsh-completion
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| PREFIX ?= /usr/local | ||
| DATAROOTDIR ?= $(PREFIX)/share | ||
| ZSH_COMPLETION_DIR ?= $(DATAROOTDIR)/zsh/site-functions | ||
|
|
||
| ZSH_COMPLETION_FILES = \ | ||
| zsh/_paccapability \ | ||
| zsh/_paccheck \ | ||
| zsh/_pacconf \ | ||
| zsh/_pacfile \ | ||
| zsh/_pacinfo \ | ||
| zsh/_pacini \ | ||
| zsh/_paclock \ | ||
| zsh/_paclog \ | ||
| zsh/_pacrepairdb \ | ||
| zsh/_pacrepairfile \ | ||
| zsh/_pacreport \ | ||
| zsh/_pacsift \ | ||
| zsh/_pacsync \ | ||
| zsh/_pactrans | ||
|
|
||
| install: | ||
| install -d "${DESTDIR}${ZSH_COMPLETION_DIR}" | ||
| install -m 644 $(ZSH_COMPLETION_FILES) "${DESTDIR}${ZSH_COMPLETION_DIR}" | ||
|
|
||
| .PHONY: install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| How to mostly autogenerate the zsh auto complete definitions | ||
|
|
||
| Write code like the following (using pacreport as an example): | ||
|
|
||
| dummy() { pacreport } | ||
| compdef _gnu_generic dummy | ||
| [tab complete "dummy -<tab>" once to cache results] | ||
| printf '%s\n' ${(onq-)_args_cache_dummy} | ||
|
|
||
| This will print entries to put in $args. After that, the following needs to be done manually: | ||
| * Completing arguments to flags (last optional field) | ||
| * Exlusivity (in leading parenthesis) & grouping of the flags. | ||
| * Repeatability (leading * after exlusivity) | ||
| * Handling any positional arguments. | ||
| * Any special handling (such as different modes, e.g. in pactrans or paclock). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #compdef paccapability | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '(-)--help[display help information]' | ||
| '(-)--version[display version information]' | ||
| '*:capability: ' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #compdef paccheck | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--backup[include backup files in modification checks]' | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--db-files[include database files in checks]' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '--depends[check for missing dependencies]' | ||
| '--file-properties[check installed files against MTREE data]' | ||
| '--files[check installed files against package database]' | ||
| '(-)--help[display help information]' | ||
| '--list-broken[only print packages that fail checks]' | ||
| '--md5sum[check file md5sums against MTREE data]' | ||
| '--noextract[include NoExtract files in modification checks]' | ||
| '--noupgrade[include NoUpgrade files in modification checks]' | ||
| '--null=[parse stdin as <sep> separated values (default NUL)]::<sep>: ' | ||
| '--opt-depends[check for missing optional dependencies]' | ||
| '--quiet[only display error messages]' | ||
| '--recursive[perform checks on package (opt-)depends]' | ||
| '--require-mtree[treat packages missing MTREE data as an error]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--sha256sum[check file sha256sums against MTREE data]' | ||
| '--sysroot=[set an alternate system root]:<path>:_path_files -/' | ||
| '(-)--version[display version information]' | ||
| '*:packages:{_values packages $(pacman -Qq)}' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #compdef pacconf | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--arch=[set an alternate architecture]:<arch>: ' | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '(-)--help[display help information]' | ||
| '--null=[use <sep> to separate values (default NUL)]::sep: ' | ||
| '--options[display all global options]' | ||
| '--raw[display unmodified values]' | ||
| '(-)--repo-list[list configured repositories]' | ||
| '--repo=[query options for a specific repo]:<remote>:{_values repo $(pacconf --repo-list)}' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--single[only display the first value for list items]' | ||
| '--verbose[always show directive names]' | ||
| '(-)--version[display version information]' | ||
| '*:directive: ' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #compdef pacfile | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--check[compare database values to filesystem]' | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '(-)--help[display help information]' | ||
| '--package=[limit information to specified package(s)]:<pkg>: ' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--sysroot=[set an alternate system root]:<path>:_path_files -/' | ||
| '(-)--version[display version information]' | ||
| '*:files:_files' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #compdef pacinfo | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--cachedir=[set an alternate cache location]:<path>:_path_files -/' | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--dbext=[set an alternate sync database extension]:<ext>: ' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '--debug[enable extra debugging messages]' | ||
| '(-)--help[display help information]' | ||
| '--no-timeout[disable low speed timeouts for downloads]' | ||
| '--null=[parse stdin as <sep> separated values (default NUL)]::sep: ' | ||
| '--raw[display raw numeric values]' | ||
| '--removable-size[include removable dependencies in size]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--short[display brief package information]' | ||
| '--verbose[display additional package information]' | ||
| '(-)--version[display version information]' | ||
| '*:pkgspec:{_values pkgspec $(pacman -Sql)}' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #compdef pacini | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '(-)--help[display help information]' | ||
| '(-)--section-list[list configured sections]' | ||
| '--section=[query options for a specific section]:<name>: ' | ||
| '--verbose[always show directive names]' | ||
| '(-)--version[display version information]' | ||
| ':file[File name]:_files' | ||
| '*:directives: ' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #compdef paclock | ||
|
|
||
| local context state state_descr line ret=1 | ||
| typeset -A opt_args | ||
| typeset -a args | ||
| args=( | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '--enoent-ok[ignore unlock errors due to a missing lock file]' | ||
| '--fail-ok[always unlock the database following --run]' | ||
| '--key=[set the lock identity key]:<id>: ' | ||
| '--lock[establish a new lock (default)]' | ||
| '--lockfile=[set the lock file path]:<path>:_files' | ||
| '--no-check-keys[skip check for matching lock file key before unlocking]' | ||
| '--print[print the lock file path exit]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--run[run a command with the database locked]' | ||
| '--sysroot=[set an alternate installation system root]:<path>:_path_files -/' | ||
| '--unlock[remove an existing lock]' | ||
| '(-)--help[display help]' | ||
| '(-)--version[display version]' | ||
| ) | ||
|
|
||
| if [[ $words[(ie)--run] -le ${#words} ]]; then | ||
| _arguments -S $args \ | ||
| '*::arguments:->cmd' \ | ||
| && ret=0 | ||
| else | ||
| _arguments -S $args \ | ||
| && ret=0 | ||
| fi | ||
|
|
||
| if [[ $state == 'cmd' ]]; then | ||
| _normal && ret=0 | ||
| fi | ||
|
|
||
| return ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #compdef paclog | ||
|
|
||
| declare -a args | ||
| args=( | ||
| + options | ||
| '(--no-color)--color[color output]' | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--debug[enable extra debugging messages]' | ||
| '--logfile=[set an alternate log file]:<path>:_files' | ||
| '(--color)--no-color[do not color output]' | ||
| '(filters)--pkglist[list installed packages (EXPERIMENTAL)]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--sysroot=[set an alternate installation system root]:<path>:_path_files -/' | ||
| '(-)--help[show help and exit]' | ||
| '(-)--version[show version and exit]' | ||
| + filters | ||
| '*--action=[show <action> entries]:<action>:(install reinstall upgrade downgrade remove all)' | ||
| '--after=[show entries after <date>]:<date>: ' | ||
| '--before=[show entries before <date>]:<date>: ' | ||
| '*--caller=[show entries from program <name>]:<name>: ' | ||
| '--commandline[show command line entries]' | ||
| '*--grep=[show entries matching <regex>]:<regex>: ' | ||
| '*--package=[show entries affecting <pkg>]:<pkg>:{_values package $(pacman -Sql)}' | ||
| '--warnings[show notes/warnings/errors]' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #compdef pacrepairdb | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--cachedir=[set an alternate cache location]:<path>:_path_files -/' | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--dbonly[update database without reinstalling packages]' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '--debug[enable extra debugging messages]' | ||
| '(-)--help[display help information]' | ||
| '--hookdir=[add additional user hook directory]:<path>:_path_files -/' | ||
| '--logfile=[set an alternate log file]:<path>:_files' | ||
| '--no-confirm[assume default responses to all prompts]' | ||
| '--no-hooks[do not run transaction hooks]' | ||
| '--no-scriptlet[do not run package install scripts]' | ||
| '--no-timeout[disable low speed timeouts for downloads]' | ||
| '--print-only[show steps without performing them]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--sysroot=[set an alternate system root]:<path>:_path_files -/' | ||
| '--verbose[display additional progress information]' | ||
| '(-)--version[display version information]' | ||
| '*:packages:{_values packages $(pacman -Qq)}' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #compdef pacrepairfile | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '--gid[set file group id]' | ||
| '(-)--help[display help information]' | ||
| '--mode[set file permissions]' | ||
| '--mtime[set file modification time]' | ||
| '--package=[search package <name> for file properties]:<name>:{_values package $(pacman -Qq)}' | ||
| '--quiet[do not display progress information]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--sysroot=[set an alternate system root]:<path>:_path_files -/' | ||
| '--uid[set file owner id]' | ||
| '(-)--version[display version information]' | ||
| '*:files:_files' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #compdef pacreport | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--backups[list .pac{save,orig,new} files]' | ||
| '--cachedir=[set an alternate cache location]:<path>:_path_files -/' | ||
| '--config=[set an alternate pacman configuration file]:<path>:_files' | ||
| '--dbext=[set an alternate sync database extension]:<ext>: ' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '*--group=[list missing group packages]:<group>:{_values group $(pacman -Sg)}' | ||
| '(-)--help[display help information]' | ||
| '--missing-files[list missing package files]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--sysroot=[set an alternate system root]:<path>:_path_files -/' | ||
| '--unowned-files[list unowned files]' | ||
| '--optional-deps[take optional dependencies into account when listing unneeded packages and dependency loops]' | ||
| '(-)--version[display version information]' | ||
| ) | ||
| _arguments $args | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #compdef pacsift | ||
|
|
||
| declare -a args | ||
| args=( | ||
| + options | ||
| '--any[display packages matching any search criteria]' | ||
| '--build-date=[search package build date]:<val>: ' | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--dbext=[set an alternate sync database extension]:<ext>: ' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '--exact[match search terms exactly]' | ||
| '(--not-exists)--exists[exit with a non-zero value if no matches were found]' | ||
| '(-)--help[display help information]' | ||
| '--invert[display packages which DO NOT match search criteria]' | ||
| '(--exists)--not-exists[exit with a non-zero value if matches were found]' | ||
| '--null=[use <sep> to separate values (default NUL)]::sep: ' | ||
| '--regex[use regular expressions for matching]' | ||
| '--root=[set an alternate installation root]:<path>:_path_files -/' | ||
| '--sysroot=[set an alternate system root]:<path>:_path_files -/' | ||
| '(-)--version[display version information]' | ||
| + filters | ||
| '--cache[search packages in cache (EXPERIMENTAL)]' | ||
| '--local[search installed packages]' | ||
| '--sync[search packages in all sync repositories]' | ||
| + package-fields | ||
| '*--architecture=[search package architecture]:<val>: ' | ||
| '*--base=[search package bases]:<val>: ' | ||
| '*--repo=[search packages in repo <name>]:<val>:{_values repo $(pacconf --repo-list)}' | ||
| '*--name=[search package names]:<val>:{_values name $(pacman -Sql)}' | ||
| '*--description=[search package descriptions]:<val>: ' | ||
| '*--packager=[search package packager field]:<val>: ' | ||
| '*--group=[search package group field]:<val>:{_values group $(pacman -Sg)}' | ||
| '*--owns-file=[search package file lists]:<val>:_files' | ||
| '*--license=[search package licenses]:<val>: ' | ||
| '*--provides=[search package provides]:<val>:{_values package $(pacman -Sql)}' | ||
| '*--depends=[search package dependencies]:<val>:{_values package $(pacman -Sql)}' | ||
| '*--optdepends=[search package dependencies]:<val>:{_values package $(pacman -Sql)}' | ||
| '*--conflicts=[search package conflicts]:<val>: ' | ||
| '*--replaces=[search package replaces]:<val>:{_values package $(pacman -Sql)}' | ||
| '*--install-date=[search package install date]:<val>: ' | ||
| '*--installed-size=[search package installed size]:<val>: ' | ||
| '*--download-size=[search package download size]:<val>: ' | ||
| '*--size=[search package size]:<val>: ' | ||
| '*--url=[search package url]:<val>: ' | ||
| '*--satisfies=[find packages satisfying dependency <val>]:<val>: ' | ||
| ) | ||
| _arguments $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #compdef pacsync | ||
|
|
||
| declare -a args | ||
| args=( | ||
| '--config=[set an alternate configuration file]:<path>:_files' | ||
| '--dbext=[set an alternate sync database extension]:<ext>: ' | ||
| '--dbpath=[set an alternate database location]:<path>:_files' | ||
| '--debug[enable extra debugging messages]' | ||
| '--force[sync repos even if already up-to-date]' | ||
| '(-)--help[display help information]' | ||
| '--logfile=[set an alternate log file]:<path>:_files' | ||
| '--no-timeout[disable low speed timeouts for downloads]' | ||
| '--sysroot=[set an alternate system root]:<path>:_path_files -/' | ||
| '--updated[return false unless a database was updated]' | ||
| '(-)--version[display version information]' | ||
| '*:repo:{_values repo $(pacconf --repo-list)}' | ||
| ) | ||
| _arguments $args |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.