Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Oct 2012 20:19:15 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: [HEADSUP] current switched by default to pkgng
Message-ID:  <5081A7B3.3040903@FreeBSD.org>
In-Reply-To: <50817DEF.4070509@lissyara.su>
References:  <20121010134421.GI26497@ithaqua.etoilebsd.net> <5081661B.2090209@lissyara.su> <50816D59.1030706@unsane.co.uk> <50816EE5.8090704@lissyara.su> <CADLo83_19dZFVyxitUs8yRt37NGepF73opsLqzR29z_Oczg_7Q@mail.gmail.com> <50817DEF.4070509@lissyara.su>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigEDCC67D679B9A0375F28B533
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 19/10/2012 17:21, Alex Keda wrote:
> On 19.10.2012 19:59, Chris Rees wrote:
>> On 19 October 2012 16:16, Alex Keda <admin@lissyara.su> 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 informa=
tion
>>>> on the different commands/,$d; s/^   *// ; s/  .*.*$// ;/^$/d'
>>>>
>>>> There's bound to be better ways, I was just bored enough to knock th=
is 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 ac=
tual
>>>> tab (ctrl-v then tab on the command line)
>>>
>>> it's crazy =3D)
>>> 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"`/'
>=20
> some not work... I try my own string:
> complete pkg           'n/*/`pkg help |& grep "Commands supported:"
> --after-context=3D100 | grep "^\s" | awk "{print $1}"`/'
>=20
> output identical. maybe pipe not work in this place?
> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org=
"
>=20

https://github.com/pkgng/pkgng/commit/8e4cc67cffe8f0afd5c0e25651bd367e121=
96bbd

Enjoy.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey



--------------enigEDCC67D679B9A0375F28B533
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCBp7oACgkQ8Mjk52CukIxR5gCeIQXLSNA9D6RitB0+5Okn01fY
oY8An31B5EPWK9dgaAF0Cc8NrXzr33W7
=Dqlo
-----END PGP SIGNATURE-----

--------------enigEDCC67D679B9A0375F28B533--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5081A7B3.3040903>