from .command_tree import CommandTree
from argument import _arguments, parse_known_args
from .history import History
+import cmd
cmd_spec_locations = [
'kamaki.cli.commands',
_print_error_message(err, verbose=_verbose)
exit(1)
+class Shell(cmd.Cmd):
+ """Kamaki interactive shell"""
+
+ def greet(self, version):
+ print('kamaki v%s - Interactive Shell\n\t(exit or ^D to exit)\n'%version)
+ def set_prompt(self, new_prompt):
+ self.prompt = '[%s]:'%new_prompt
+
+ def do_exit(self, line):
+ return True
+
+shell = None
+
+def _start_shell():
+ shell = Shell()
+ shell.set_prompt(basename(argv[0]))
+ from kamaki import __version__ as version
+ shell.greet(version)
+ shell.do_EOF = shell.do_exit
+ shell.cmdloop()
+
+def shell():
+ _start_shell()
+
+def main():
+ if len(argv) <= 1:
+ shell()
+ else:
+ one_command()
\ No newline at end of file
def do_EOF(self, line):
return True
-#sh = Shell()
-#sh.prompt = 'lala_$ '
-#sh.cmdloop()
-
-#import sys
-#sh.onecmd(' '.join(sys.argv[1:]))
-#test_CommandTree()
\ No newline at end of file
+if __name__ == '__main__':
+ sh = Shell()
+ sh.prompt = 'lala_$ '
+ sh.cmdloop()
+
+ #import sys
+ #sh.onecmd(' '.join(sys.argv[1:]))
+ #test_CommandTree()
\ No newline at end of file
packages=['kamaki', 'kamaki.cli', 'kamaki.clients', 'kamaki.clients.connection', 'kamaki.cli.commands'],
include_package_data=True,
entry_points={
- 'console_scripts': ['kamaki = kamaki.cli:one_command']
+ 'console_scripts': ['kamaki = kamaki.cli:main']
},
install_requires=required
)