On Tue-2010/08/17-23:09 thierry wrote: > As a ledger newbie, I have difficulties to remember all the commands > and options of ledger (and i'm lazy to open, man ledger, ledger.pdf, > etc), and I'm lazy too to type the long option (while long option is > easier to remember than the short ones maybe preferable for long time > hacker), so I decided to investigate around bash completion, and its > use for ledger.
> ... > # 26 commands > # command explicitely filtered out: push pop reload draft > commands="accounts balance budget cleared commodities convert csv > echo emacs entry equity payees pricedb pricemap prices print register > server source stats xact xml" I usually make completers without adding the literal commands, but parsing the "<cmd> --help" output can be a PITA. Your code looks ok, otherwise. So I take this opportunity to ask for option "--help-commands-plain" and "--help-options-plain" or somesuch, giving all the subcommands and options one to a line. Implemented for all commands, it would help making completers that are independent of commands or new releases way easier! clemens
