Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Apr 2015 18:12:09 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        "Sergey V. Dyatko" <sergey.dyatko@gmail.com>
Cc:        pkg <pkg@freebsd.org>, Kevin Oberman <rkoberman@gmail.com>
Subject:   Re: Share your pkg aliases
Message-ID:  <alpine.BSF.2.20.1504061808420.72595@wonkity.com>
In-Reply-To: <20150406093428.7027c046@laptop.minsk.domain>
References:  <20150402201909.GD30115@ivaldir.etoilebsd.net> <CAG=rPVf-wJHVbB5ivL_GcK1ahz8cdFW1BNwfO6jfGfqhc0OFWg@mail.gmail.com> <CAN6yY1ux0diXK-5kFVshSkCi9FPe0jik_DkB9QgT2AxF=9sWsA@mail.gmail.com> <20150406093428.7027c046@laptop.minsk.domain>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 6 Apr 2015, Sergey V. Dyatko wrote:

> On Fri, 3 Apr 2015 20:15:29 -0700
> Kevin Oberman <rkoberman@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@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`/'




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1504061808420.72595>