Share your pkg aliases
Warren Block
wblock at wonkity.com
Tue Apr 7 00:12:18 UTC 2015
On Mon, 6 Apr 2015, Sergey V. Dyatko wrote:
> On Fri, 3 Apr 2015 20:15:29 -0700
> Kevin Oberman <rkoberman at gmail.com> wrote:
>
>> And I keep meaning to write a tcsh completion script for pkg. Maybe I'll
>> get to at least a basic one next week. I see that bash completion scripts
>> are quite different, but I'll see if the _pkg.bash file can at least get me
>> started. It does more than I'd probably get done in the first pass.
>> --
>> Kevin Oberman, Network Engineer, Retired
>> E-mail: rkoberman at gmail.com
>
> Long time ago I started to do that:
> https://github.com/yoursbofh/pkgng-tcsh/blob/master/dot.cshrc_pkg
> but ENOTIME and so on :) I would be very glad if someone will continue
This does some of it. More would be welcome. Sorry about the wrap:
set pkgcmds=(help add annotate audit autoremove backup check clean convert create delete fetch info install lock plugins \
query register repo rquery search set shell shlib stats unlock update updating upgrade version which)
alias __pkgs 'pkg info -q'
# aliases that show lists of possible completions including both package names and options
alias __pkg-check-opts '__pkgs | xargs echo -B -d -s -r -y -v -n -a -i g x'
alias __pkg-del-opts '__pkgs | xargs echo -a -D -f -g -i -n -q -R -x -y'
alias __pkg-info-opts '__pkgs | xargs echo -a -A -f -R -e -D -g -i -x -d -r -k -l -b -B -s -q -O -E -o -p -F'
alias __pkg-which-opts '__pkgs | xargs echo -q -o -g'
complete pkg 'p/1/$pkgcmds/' \
'n/check/`__pkg-check-opts`/' \
'N/check/`__pkgs`/' \
'n/delete/`__pkg-del-opts`/' \
'N/delete/`__pkgs`/' \
'n/help/$pkgcmds/' \
'n/info/`__pkg-info-opts`/' \
'N/info/`__pkgs`/' \
'n/which/`__pkg-which-opts`/' \
'N/which/`__pkgs`/'
More information about the freebsd-pkg
mailing list