aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-10-28 21:26:59 +0100
committerMattias Andrée <maandree@operamail.com>2012-10-28 21:26:59 +0100
commit15da86d3edf6e2c1636aacfe5ae5d50728d3c365 (patch)
treeb1921ab83cc01da97a7f2b9f206bbe6ef1324eb0
parentPartially the structure to make it easier for the generators (diff)
downloadauto-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
-rwxr-xr-xauto-auto-complete.py23
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)