diff --git a/inary/cli/command.py b/inary/cli/command.py index 88b98de46d196d0262cc776707045fc13f014687..72bcf672314838aee3969e9829b1da8bf899de1b 100644 --- a/inary/cli/command.py +++ b/inary/cli/command.py @@ -35,20 +35,22 @@ class autocommand(type): name = getattr(cls, 'name', None) if name is None: raise inary.cli.Error(_('Command lacks name.')) - longname, shortname = name - - def add_cmd(cmd): + + def add_cmd(cmd,skip_duplicate=False): if cmd in Command.cmd_dict: - raise inary.cli.Error( - _('Duplicate command \'{}\'').format(cmd)) + if not skip_duplicate: + raise inary.cli.Error( + _('Duplicate command \'{}\'').format(cmd)) else: Command.cmd_dict[cmd] = cls - add_cmd(longname) - if shortname: - add_cmd(shortname) - + for cmd_name in name: + if cmd_name: + add_cmd(cmd_name) + add_cmd(_(name[0]),True) + + class Command(object): """generic help string for any command""" @@ -65,10 +67,10 @@ class Command(object): commandcls = Command.cmd_dict[name] trans = gettext.translation('inary', fallback=True) summary = trans.gettext(commandcls.__doc__).split('\n')[0] - name = commandcls.name[0] + name = _(commandcls.name[0]) if commandcls.name[1]: name += ' ({})'.format(commandcls.name[1]) - s += util.colorize(' %23s ' % name, 'blue') + '- %s\n' % summary + s += util.colorize(' %23s ' % name, 'red') + '- %s\n' % summary return s @staticmethod diff --git a/inary/cli/init.py b/inary/cli/init.py index 497981a1424df8ebde00434680e96858a2e9856d..5a122e746f91363647b1cf6e3128f578ac733531 100644 --- a/inary/cli/init.py +++ b/inary/cli/init.py @@ -28,7 +28,7 @@ class InitNothing(command.PackageOp, metaclass=command.autocommand): def __init__(self, args): super(InitNothing, self).__init__(args) - name = (_("init"), "i") + name = ("init", "i") def options(self): pass diff --git a/po/tr.po b/po/tr.po index 4d40ebfce5dbbc647976c34fe4d6e62312abcb9f..8ed69c15de634b41e3b2b1b749901e1349c5e668 100644 --- a/po/tr.po +++ b/po/tr.po @@ -3708,6 +3708,7 @@ msgstr "\"{0}\" için dönüş değeri {1}" msgid "Invalid version string: '{}'" msgstr "Hatalı sürüm dizgisi: '{}'" + #~ msgid "Upgrade is not possible." #~ msgstr "Yükseltme mümkün değil."