diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-10-28 21:26:59 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-10-28 21:26:59 +0100 |
commit | 15da86d3edf6e2c1636aacfe5ae5d50728d3c365 (patch) | |
tree | b1921ab83cc01da97a7f2b9f206bbe6ef1324eb0 /auto-auto-complete.py | |
parent | Partially the structure to make it easier for the generators (diff) | |
download | auto-auto-complete-15da86d3edf6e2c1636aacfe5ae5d50728d3c365.tar.gz auto-auto-complete-15da86d3edf6e2c1636aacfe5ae5d50728d3c365.tar.bz2 auto-auto-complete-15da86d3edf6e2c1636aacfe5ae5d50728d3c365.tar.xz |
use reflection to get a generator for the specified shell
Diffstat (limited to 'auto-auto-complete.py')
-rwxr-xr-x | auto-auto-complete.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/auto-auto-complete.py b/auto-auto-complete.py index a0e199d..4280e61 100755 --- a/auto-auto-complete.py +++ b/auto-auto-complete.py @@ -159,6 +159,25 @@ class Parser: stack.append(item) + +''' +Completion script generator for GNU Bash +''' +class GeneratorBASH: + ''' + Constructor + + @param program:str The command to generate completion for + @param unargumented:list<dict<str, list<str>>> Specification of unargumented options + @param argumented:list<dict<str, list<str>>> Specification of argumented options + @param variadic:list<dict<str, list<str>>> Specification of variadic options + @param suggestion:list<list<↑|str>> Specification of argument suggestions + ''' + def __init__(self, program, unargumented, argumented, variadic, suggestion): + print("{bash}") + + + ''' mane! ''' @@ -231,5 +250,7 @@ if __name__ == '__main__': map[elem[0]] = elem[1:] group[index] = map - print(shell) + generator = 'Generator' + shell + generator = globals()[generator] + generator = generator(program, unargumented, argumented, variadic, suggestion) |