From owner-freebsd-questions@FreeBSD.ORG Sat Jan 3 19:37:44 2015 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B4A8E5C for ; Sat, 3 Jan 2015 19:37:44 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3B11034 for ; Sat, 3 Jan 2015 19:37:43 +0000 (UTC) Received: from r56.edvax.de (port-92-195-85-165.dynamic.qsc.de [92.195.85.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 13B3B3CE47; Sat, 3 Jan 2015 20:37:34 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t03JbYfW002410; Sat, 3 Jan 2015 20:37:34 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 3 Jan 2015 20:37:34 +0100 From: Polytropon To: Michael =?UTF-8?B?R3LDvG5ld2FsZA==?= Subject: Re: TCSH completion patterns and the pkg command Message-Id: <20150103203734.5086dfd6.freebsd@edvax.de> In-Reply-To: <54A85003.3000301@gmail.com> References: <54A85003.3000301@gmail.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 19:37:44 -0000 On Sat, 03 Jan 2015 21:24:35 +0100, Michael Grünewald wrote: > The C-shell included in the base system is a popular(?) interactive > shell among FreeBSD users. The C shell is the system's _default_ interactive shell. This statement does not carry any judgmental statement. :-) > Some popular software package such as git or subversion use a small > variation of this UNIX syntax which, to the best of my knowledge, > defeats the C-shell: > > command subcommand -a argA -b argB --longopt longarg item1 item2 … > > Today, there is several important commands in FreeBSD using such > a scheme, such as pkg, pw or gpart. > > Do we have any plans to enhance the C-shell completion features to > deal nicely with this scheme? > > An easy workaround is to define an alias for each subcommand, I use > this strategy in my tcshfiles: > > https://github.com/michipili/tcshfiles/commit/9caf67c In my opinion, this is possible, but not easy. I'd say it's easier to teach the C shell the completition rules for the commands you want. Here's an example: complete gpart 'p/*/(add backup bootcode commit <... more ...>)/' This should work the same for pkg, pw, svn, git, zfs, zpool and so on. A similar approach works nicely for dd. Additionally, you don't have to "pollute" your system with aliases which only exist for the sake of completition. > It would however be nicer to have a more capable completion system > in the C-shell. It should be no problem if additional settings like those, when desired by the users' community, would be included per default in the /etc/csh.cshrc global file. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...