bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I get a hint, please?


From: Eric Blake
Subject: Re: Can I get a hint, please?
Date: Sat, 07 Oct 2006 11:01:21 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruce Korb on 10/7/2006 8:09 AM:
> That got me thinking.  csh/bash have this cute feature of giving
> hints when the tab key is pressed.  Programs nowadays are elf
> and elf allows for arbitrary sections to be added into a binary
> that won't affect the execution.  Suppose, for example, there
> were a section named, ".options" and it contained a magic number
> to ensure the right version of the right thing were being looked
> at.  Now if someone presses "tab" after the command name you could
> actually emit real usage text.  :)  Further, in answer to David's
> auto-reordering suggestion, with that option the arguments can
> be scanned and you'll know if the ``-l'' flag takes an argument
> or not and, thus, be able to correctly reorder.

Bash already has programmable tab completion, although I'm not sure if you
would be able to hook argument reordering into it easily.  But PLEASE
don't assume the entire world is elf.  Bash is ported to a number of
non-elf platforms, such as PE-COFF of Windows.  Hooking in a readline
command that examines the command enough to know which options take
arguments so that reordering will not change the semantics of the command
sounds admirable, but doing so by parsing the target executable just does
not sound like the right approach to me.  We don't need to bloat bash by
adding all of the binutils capabilities into it.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFJ91h84KuGfSFAYARAliSAJ0SMZxdF0APVQKolug34SiRr7S2NACeIJ9r
b8TK6UyvYrZydJ7AuJwo2Lc=
=iWgW
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]