Re: Problem regarding command line completion

2011-10-03 Thread Peter Otten
-invert-match","--word-regexp","--line-regexp"] > def complete_grep(self, text, line, begidx, endidx): > return [i for i in CmdLineApp.option if > i.startswith(text)] > > interpreter = CmdLineApp() > interpreter.cmdloop()

Problem regarding command line completion

2011-10-03 Thread Rajashree Thorat
def complete_grep(self, text, line, begidx, endidx): return [i for i in CmdLineApp.option if i.startswith(text)] interpreter = CmdLineApp() interpreter.cmdloop() In above program I want to do command line completion (or tab completion). If the elements of option li

Re: line completion

2009-08-22 Thread Chris Rebert
On Thu, Aug 20, 2009 at 9:06 AM, Steven Woody wrote: > Hi, > I wrote a program that takes some user input.  Many inputs are quit often > used by user, so when a user launch the program, and type in "The Sha",  he > wants to get "wshank Redemption" displayed automatically in reversed color > (black

line completion

2009-08-22 Thread Steven Woody
Hi, I wrote a program that takes some user input. Many inputs are quit often used by user, so when a user launch the program, and type in "The Sha", he wants to get "wshank Redemption" displayed automatically in reversed color (black text on white background) along his cursor. When he decided to

Re: Line completion with custom commands

2009-01-09 Thread gu
Marco Mariani wrote: gu wrote: I see, but how does django-admin work, then? from bash: complete -W "doSomething doSomethingElse doSomethingDifferent" myProgram This worked like a charm, thank you so much. Is this available for bash only or any shell? -- http://mail.python.org/mailman/lis

Re: Line completion with custom commands

2009-01-09 Thread Steve Holden
gu wrote: > Steve Holden wrote: >> gu wrote: >>> Hi, my Python program can be launched with a range of different options >>> (or subcommands) like: >>> >>> $ myProgram doSomething >>> $ myProgram doSomethingElse >>> $ myProgram nowDoSomethingDifferent >>> >>> I want it to use auto-completion with s

Re: Line completion with custom commands

2009-01-09 Thread Marco Mariani
gu wrote: I see, but how does django-admin work, then? from bash: complete -W "doSomething doSomethingElse doSomethingDifferent" myProgram -- http://mail.python.org/mailman/listinfo/python-list

Re: Line completion with custom commands

2009-01-09 Thread gu
Steve Holden wrote: gu wrote: Hi, my Python program can be launched with a range of different options (or subcommands) like: $ myProgram doSomething $ myProgram doSomethingElse $ myProgram nowDoSomethingDifferent I want it to use auto-completion with so that if i type "myProgram d" it returns

Re: Line completion with custom commands

2009-01-09 Thread Steve Holden
gu wrote: > > Hi, my Python program can be launched with a range of different options > (or subcommands) like: > > $ myProgram doSomething > $ myProgram doSomethingElse > $ myProgram nowDoSomethingDifferent > > I want it to use auto-completion with so that if i type "myProgram d" it > returns "m

Line completion with custom commands

2009-01-09 Thread gu
Hi, my Python program can be launched with a range of different options (or subcommands) like: $ myProgram doSomething $ myProgram doSomethingElse $ myProgram nowDoSomethingDifferent I want it to use auto-completion with so that if i type "myProgram d" it returns "myProgram doSomething" and