From owner-freebsd-current@FreeBSD.ORG Sat Oct 20 07:21:58 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9ED38B5 for ; Sat, 20 Oct 2012 07:21:58 +0000 (UTC) (envelope-from sergey.dyatko@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 353238FC12 for ; Sat, 20 Oct 2012 07:21:57 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so983105lbd.13 for ; Sat, 20 Oct 2012 00:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=1Pai6kNsf2yrtLuY3Pi58q768ZytIjoY2SVqeVNTBE8=; b=J2COvo3LXig6fYFevC8MnEy2NEdG5TbmvpYjmeyUVQnK95EXGLTUgC8pG2OsxbOmxh DfaRHNuaH+xd1vvKIziPm5SKAoLmBPJ5xYjKBjIAJB5qp7mBPFzw9JKlSQ4UYIsIEF+7 QeqQWKk8pbTkFyIr9B7eOfpXQxJDpTnjnQuEBxknXjaADTLRjyXNHvwK4uPl/slpEXg6 G9p9YEhGuCKgC98WkkRhCagONhGpJ8Z3KbGuy0X7aNOZOMFn2CNYdBLkVZNCTQ3NBk3P g9446S0QtHR80vSlurc+Bk7pOIegFjTnBj0REPEJ/A+zmwBiv8JH/b9eIoPvwsFcMg4m Tpmw== Received: by 10.152.129.197 with SMTP id ny5mr617737lab.43.1350717716742; Sat, 20 Oct 2012 00:21:56 -0700 (PDT) Received: from laptop ([178.125.31.12]) by mx.google.com with ESMTPS id n2sm1195288lbg.2.2012.10.20.00.21.54 (version=SSLv3 cipher=OTHER); Sat, 20 Oct 2012 00:21:55 -0700 (PDT) Date: Sat, 20 Oct 2012 10:23:25 +0300 From: "Sergey V. Dyatko" To: freebsd-current@freebsd.org Subject: Re: [HEADSUP] current switched by default to pkgng Message-ID: <20121020102325.25b9571b@laptop> In-Reply-To: <5081809F.8010003@lissyara.su> References: <20121010134421.GI26497@ithaqua.etoilebsd.net> <5081661B.2090209@lissyara.su> <50816D59.1030706@unsane.co.uk> <50816EE5.8090704@lissyara.su> <50817DEF.4070509@lissyara.su> <5081809F.8010003@lissyara.su> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 07:21:58 -0000 On Fri, 19 Oct 2012 20:32:31 +0400 Alex Keda wrote: > On 19.10.2012 20:21, Alex Keda wrote: > > On 19.10.2012 19:59, Chris Rees wrote: > >> On 19 October 2012 16:16, Alex Keda wrote: > >>> On 19.10.2012 19:10, Vincent Hoffman wrote: > >>>> On 19/10/2012 15:39, Alex Keda wrote: > >>>>> pkg command does not have key for list options - no > >>>>> autocompletions > >>>>> > >>>>> for example, for service command, I use > >>>>> complete service 'n/*/`service -l`/' > >>>>> in .cshrc > >>>>> > >>>>> what I can use for pkg command? > >>>> > >>>> horrible but working example > >>>> pkg help 2>&1 | sed -e '1,/Commands supported:/d ; /For more > >>>> information on the different commands/,$d; s/^ *// ; > >>>> s/ .*.*$// ;/^$/d' > >>>> > >>>> There's bound to be better ways, I was just bored enough to > >>>> knock this up. note s/^ *// is a tab, while s/ .*.*$// is > >>>> 2 spaces dont think our sed has any other way to express tab > >>>> other than an actual tab (ctrl-v then tab on the command line) > >>> > >>> it's crazy =) > >>> may be add -l options? > >> > >> For Bourne-style shell: > >> `pkg help 2>&1 | sed -nE 's,^ +(.*),\1,p'` > >> > >> For csh-style shell: > >> `pkg help | & sed -nE 's,^ +(.*),\1,p'` > >> > >> where the bit between ^ and + is a tab character. You can type the > >> tab character on a command prompt by using Ctrl+V then tab, or just > >> type it normally in the script. > >> > >> Hope that helps in the meantime. > >> > >> Chris > >> > > dc7700p# pkg > > -c Displays Performs a and > > check debug from inside local > > package packages remote search system > > updating > > -d Displays Performs a and > > ......... skipped ........ > > Displays Opens a against catalogues > > debug from inside link package > > packages register search system update > > dc7700p# > > dc7700p# grep pkg /root/.cshrc > > complete pkg 'n/*/`pkg help |& sed -nE "s,^ > > +(.*),\1,p"`/' > > > > some not work... I try my own string: > > complete pkg 'n/*/`pkg help |& grep "Commands supported:" > > --after-context=100 | grep "^\s" | awk "{print $1}"`/' > > > > output identical. maybe pipe not work in this place? > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to > > "freebsd-current-unsubscribe@freebsd.org" > > > > it's a good crutch =) > > dc7700p# pkg > add autoremove check create fetch info > query remove rquery set shlib update upgrade > which > audit backup clean delete help install > register repo search shell stats updating > version > dc7700p# pkg > dc7700p# grep pkg /root/.cshrc > complete pkg 'n/*/`pkg help |& grep "Commands supported:" > --after-context=100 | grep "^\s" | cut -d " " -f 1`/' > dc7700p# > > https://github.com/yoursbofh/pkgng-tcsh/blob/master/dot.cshrc_pkg Unfortunately, I do not know how to do something like `pkg command <-keys> ` i.e. 'n/audit/' 'c/-/(F q)/' '`pkg query "%n-%v"`/' doesn't work :( [tiger@laptop]:~%pkg audit [tab] Missing separator '/' after completion "". -- wbr, tiger