exit(0)
_init_session(_arguments)
+ print('ICN[%s]' % _arguments['config'].value)
if unparsed:
_history = History(_arguments['config'].get('history', 'file'))
class ConfigArgument(Argument):
+ _config_file = None
+
@property
def value(self):
super(self.__class__, self).value
@value.setter
def value(self, config_file):
- self._value = Config(config_file) if config_file else Config()
+ if config_file:
+ self._value = Config(config_file)
+ self._config_file = config_file
+ elif self._config_file:
+ self._value = Config(self._config_file)
+ else:
+ self._value = Config()
def get(self, group, term):
return self.value.get(group, term)
from argparse import ArgumentParser
from kamaki.cli import _exec_cmd, _print_error_message
-from kamaki.cli.argument import _arguments, update_arguments
+from kamaki.cli.argument import update_arguments
from kamaki.cli.utils import print_dict
from kamaki.cli.history import History
from kamaki.cli.errors import CLIError
arguments.pop('version', None)
arguments.pop('options', None)
arguments.pop('history', None)
+ print('SHELL? [%s]' % arguments['config'].value)
shell = Shell()
shell.set_prompt(exe_string)
from kamaki import __version__ as version
from kamaki.cli.command_tree import CommandTree
config_cmds = CommandTree('config', 'Configuration commands')
-_command = [config_cmds]
+_commands = [config_cmds]
@command(config_cmds)