# Path: syncano_cli/config.py
# ACCOUNT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.syncano')
# 
# Path: syncano_cli/config_commands/command.py
# class ConfigCommand(BaseInstanceCommand):
# 
#     def config_show(self):
#         config = self.instance.get_config()
#         self._show_config(config)
# 
#     def _show_config(self, config):
#         self.formatter.write('Config for Instance {}'.format(self.instance.name), TopSpacedOpt())
#         self.formatter.display_config(config)
# 
#     def add(self, name, value):
#         config = self.instance.get_config()
#         if name in config:
#             raise VariableInConfigException(format_args=[name])
#         config.update({name: value})
#         self.instance.set_config(config)
#         self.formatter.write('Variable `{}` set to `{}` in instance `{}`.'.format(
#             name, value, self.instance.name), TopSpacedOpt())
#         self._show_config(config)
# 
#     def modify(self, name, value):
#         config = self.instance.get_config()
#         config.update({name: value})
#         self.instance.set_config(config)
#         self.formatter.write('Variable `{}` set to `{}` in instance `{}`.'.format(
#             name, value, self.instance.name), TopSpacedOpt())
#         self._show_config(config)
# 
#     def delete(self, name):
#         config = self.instance.get_config()
#         if name in config:
#             config.pop(name)
#         else:
#             raise VariableNotFoundException(format_args=[name])
#         self.instance.set_config(config)
#         self.formatter.write('Variable `{}` removed from instance `{}`.'.format(
#             name, self.instance.name), TopSpacedOpt())
#         self._show_config(config)


import click
from syncano_cli.config import ACCOUNT_CONFIG_PATH
from syncano_cli.config_commands.command import ConfigCommand
# -*- coding: utf-8 -*-



@click.group()
def top_config():
    pass


@top_config.group(invoke_without_command=True)
@click.pass_context
@click.option('--config', help=u'Account configuration file.', default=ACCOUNT_CONFIG_PATH)
@click.option('--instance-name', help=u'Instance name.')
def config(ctx, config, instance_name):
    """Allow to manage global Instance config."""


# Path: syncano_cli/config.py
# ACCOUNT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.syncano')
# 
# Path: syncano_cli/config_commands/command.py
# class ConfigCommand(BaseInstanceCommand):
# 
#     def config_show(self):
#         config = self.instance.get_config()
#         self._show_config(config)
# 
#     def _show_config(self, config):
#         self.formatter.write('Config for Instance {}'.format(self.instance.name), TopSpacedOpt())
#         self.formatter.display_config(config)
# 
#     def add(self, name, value):
#         config = self.instance.get_config()
#         if name in config:
#             raise VariableInConfigException(format_args=[name])
#         config.update({name: value})
#         self.instance.set_config(config)
#         self.formatter.write('Variable `{}` set to `{}` in instance `{}`.'.format(
#             name, value, self.instance.name), TopSpacedOpt())
#         self._show_config(config)
# 
#     def modify(self, name, value):
#         config = self.instance.get_config()
#         config.update({name: value})
#         self.instance.set_config(config)
#         self.formatter.write('Variable `{}` set to `{}` in instance `{}`.'.format(
#             name, value, self.instance.name), TopSpacedOpt())
#         self._show_config(config)
# 
#     def delete(self, name):
#         config = self.instance.get_config()
#         if name in config:
#             config.pop(name)
#         else:
#             raise VariableNotFoundException(format_args=[name])
#         self.instance.set_config(config)
#         self.formatter.write('Variable `{}` removed from instance `{}`.'.format(
#             name, self.instance.name), TopSpacedOpt())
#         self._show_config(config)


# Path: syncano_cli/config_commands/commands.py
import click
from syncano_cli.config import ACCOUNT_CONFIG_PATH
from syncano_cli.config_commands.command import ConfigCommand

# -*- coding: utf-8 -*-



@click.group()
def top_config():
    pass


@top_config.group(invoke_without_command=True)
@click.pass_context
@click.option('--config', help=u'Account configuration file.', default=ACCOUNT_CONFIG_PATH)
@click.option('--instance-name', help=u'Instance name.')
def config(ctx, config, instance_name):
    """Allow to manage global Instance config."""


    config_command = ConfigCommand(config)