Share your pkg aliases
Kevin Oberman
rkoberman at gmail.com
Wed Apr 8 06:39:45 UTC 2015
On Mon, Apr 6, 2015 at 5:12 PM, Warren Block <wblock at wonkity.com> wrote:
> 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`/'
>
Thank you! You seem to have done almost exactly what I had started on and
was planning on. I will try to add come of the commands still not handled
and update some that are. (Where is my copy of "csh and tcsh"?) I will be
moving in two weeks and I may have already packed it up.)
--
Kevin Oberman, Network Engineer, Retired
E-mail: rkoberman at gmail.com
More information about the freebsd-pkg
mailing list