Permalink
Find file
c976b26 Dec 24, 2016
70 lines (64 sloc) 3.34 KB
#compdef porg
# The MIT License (MIT)
#
# Copyright (c) 2016 Syohei YOSHIDA
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
local -a packages
packages=($(porg -a 2>/dev/null))
local -a sortby
sortby=(name date size files)
_arguments -n : \
'(-a --all)'{-a,--all}'[Apply to all logged packages]' \
'(-L --logdir)'{-L,--logdir}'[Base log directory]:Dir:_files -/' \
'(-v --verbose)'{-v,--verbose}'[Verbose output]' \
'(-x,--extract-version)'{-x,--extract-version}'[Do not expand version of packages given as arguments.]' \
'(- :)'{-h,--help}'[Display a help message and exit]' \
'(- :)--version[Display version information and exit]' \
'(-R --reverse)'{-R,--reverse}'[Reverse order while sorting]' \
'(-t --total)'{-t,--total}'[Print totals]' \
'(-z --no-package-name)'{-z,--no-package-name}'[Do not print the name of package]' \
'(-d --date)'{-d,--data}'[Show installation date]' \
'(-s --size)'{-s,--size}'[Show the currently installed size of each package]' \
'(-F --nfiles)'{-F,--nfiles}'[Print the number of installed files]' \
'(-S --sort)'{-S,--sort}'[Sort list by WORD]:Sort Unit:(name date size files)' \
'(-f --files)'{-f,--files}'[List the files installed by the package]' \
'(-y --symlinks)'{-y,--symlinks}'[Print the contents of symbolic links]' \
'(-i --info)'{-i,--info}'[Print package information]' \
'(-o --configure-options)'{-o,--configure-options}'[Print the configure options]' \
'(-q --query)'{-q,--query}'[Query for the packages]' \
'(-r --remove)'{-r,--remove}'[Remove the package]' \
'(-b --batch)'{-b,--batch}'[Do not ask for confirmation when removing or unlogging]' \
'(-e --skip)'{-e,--ekip}'[Do not remove files in these paths]' \
'(-U --unlog)'{-U,--unlog}'[Remove the log of the package from the database]' \
'(-l --log)'{-l,--log}'[Enable log mode]' \
'(-p --package)'{-p,--package}'[Specify the package name]::'"($packages)" \
'(-D --dirname)'{-d,--dirname}'[Use current directory as package name logged]' \
'(-+ --apend)'{-+,--append}'[Append the list of files]' \
'(-j --log-missing)'{-j,--log-missing}'[Log also the missing files]' \
'(-I --include)'{-I,--include}'[List of paths to scan]' \
'(-E --exclude)'{-E,--exclude}'[List of paths to skip]' \
'*: :'"($packages)"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et