VirtualMailManager/cli/subcommands.py
branchv0.6.x
changeset 469 1ebb6b88f589
parent 462 a64c1b5e08b4
child 471 5d0114f7bb99
equal deleted inserted replaced
468:89bf9389d62f 469:1ebb6b88f589
   667 def update_cmd_map():
   667 def update_cmd_map():
   668     """Update the cmd_map, after gettext's _ was installed."""
   668     """Update the cmd_map, after gettext's _ was installed."""
   669     cmd = Command
   669     cmd = Command
   670     cmd_map.update({
   670     cmd_map.update({
   671     # Account commands
   671     # Account commands
   672     'getuser': cmd('getuser', 'gu', get_user, _(u'uid'),
   672     'getuser': cmd('getuser', 'gu', get_user, 'uid',
   673                    _(u'get the address of the user with the given UID')),
   673                    _(u'get the address of the user with the given UID')),
   674     'useradd': cmd('useradd', 'ua', user_add, _(u'address [password]'),
   674     'useradd': cmd('useradd', 'ua', user_add, 'address [password]',
   675                    _(u'create a new e-mail user with the given address')),
   675                    _(u'create a new e-mail user with the given address')),
   676     'userdelete': cmd('userdelete', 'ud', user_delete,
   676     'userdelete': cmd('userdelete', 'ud', user_delete, 'address [force]',
   677                       _(u'address') + ' [force]',
       
   678                       _(u'delete the specified user')),
   677                       _(u'delete the specified user')),
   679     'userinfo': cmd('userinfo', 'ui', user_info, _(u'address [details]'),
   678     'userinfo': cmd('userinfo', 'ui', user_info, 'address [details]',
   680                     _(u'display information about the given address')),
   679                     _(u'display information about the given address')),
   681     'username': cmd('username', 'un', user_name, _(u'address name'),
   680     'username': cmd('username', 'un', user_name, 'address name',
   682                     _(u'set or update the real name for an address')),
   681                     _(u'set or update the real name for an address')),
   683     'userpassword': cmd('userpassword', 'up', user_password,
   682     'userpassword': cmd('userpassword', 'up', user_password,
   684                         _(u'address [password]'),
   683                         'address [password]',
   685                         _(u'update the password for the given address')),
   684                         _(u'update the password for the given address')),
   686     'userquota': cmd('userquota', 'uq', user_quota,
   685     'userquota': cmd('userquota', 'uq', user_quota,
   687                      _(u'address storage [messages]'),
   686                      'address storage [messages]',
   688                      _(u'update the quota limit for the given address')),
   687                      _(u'update the quota limit for the given address')),
   689     'userservices': cmd('userservices', 'us', user_services,
   688     'userservices': cmd('userservices', 'us', user_services,
   690                         _(u'address [service ...]'),
   689                         'address [service ...]',
   691                         _(u'enables the specified services and disables all '
   690                         _(u'enables the specified services and disables all '
   692                           u'not specified services')),
   691                           u'not specified services')),
   693     'usertransport': cmd('usertransport', 'ut', user_transport,
   692     'usertransport': cmd('usertransport', 'ut', user_transport,
   694                          _(u'address transport'),
   693                          'address transport',
   695                          _(u'update the transport of the given address')),
   694                          _(u'update the transport of the given address')),
   696     # Alias commands
   695     # Alias commands
   697     'aliasadd': cmd('aliasadd', 'aa', alias_add, _(u'address destination ...'),
   696     'aliasadd': cmd('aliasadd', 'aa', alias_add, 'address destination ...',
   698                     _(u'create a new alias e-mail address with one or more '
   697                     _(u'create a new alias e-mail address with one or more '
   699                       u'destinations')),
   698                       u'destinations')),
   700     'aliasdelete': cmd('aliasdelete', 'ad', alias_delete,
   699     'aliasdelete': cmd('aliasdelete', 'ad', alias_delete,
   701                        _(u'address [destination]'),
   700                        'address [destination]',
   702                        _(u'delete the specified alias e-mail address or one '
   701                        _(u'delete the specified alias e-mail address or one '
   703                          u'of its destinations')),
   702                          u'of its destinations')),
   704     'aliasinfo': cmd('aliasinfo', 'ai', alias_info, _(u'address'),
   703     'aliasinfo': cmd('aliasinfo', 'ai', alias_info, 'address',
   705                      _(u'show the destination(s) of the specified alias')),
   704                      _(u'show the destination(s) of the specified alias')),
   706     # AliasDomain commands
   705     # AliasDomain commands
   707     'aliasdomainadd': cmd('aliasdomainadd', 'ada', aliasdomain_add,
   706     'aliasdomainadd': cmd('aliasdomainadd', 'ada', aliasdomain_add,
   708                           _(u'fqdn destination'),
   707                           'fqdn destination',
   709                           _(u'create a new alias for an existing domain')),
   708                           _(u'create a new alias for an existing domain')),
   710     'aliasdomaindelete': cmd('aliasdomaindelete', 'add', aliasdomain_delete,
   709     'aliasdomaindelete': cmd('aliasdomaindelete', 'add', aliasdomain_delete,
   711                              _(u'fqdn'),
   710                              'fqdn', _(u'delete the specified alias domain')),
   712                              _(u'delete the specified alias domain')),
   711     'aliasdomaininfo': cmd('aliasdomaininfo', 'adi', aliasdomain_info, 'fqdn',
   713     'aliasdomaininfo': cmd('aliasdomaininfo', 'adi', aliasdomain_info,
       
   714                          _(u'fqdn'),
       
   715                          _(u'show the destination of the given alias domain')),
   712                          _(u'show the destination of the given alias domain')),
   716     'aliasdomainswitch': cmd('aliasdomainswitch', 'ads', aliasdomain_switch,
   713     'aliasdomainswitch': cmd('aliasdomainswitch', 'ads', aliasdomain_switch,
   717                        _(u'fqdn destination'),
   714                              'fqdn destination', _(u'assign the given alias '
   718                        _(u'assign the given alias domain to an other domain')),
   715                              'domain to an other domain')),
   719     # Domain commands
   716     # Domain commands
   720     'domainadd': cmd('domainadd', 'da', domain_add, _(u'fqdn [transport]'),
   717     'domainadd': cmd('domainadd', 'da', domain_add, 'fqdn [transport]',
   721                      _(u'create a new domain')),
   718                      _(u'create a new domain')),
   722     'domaindelete': cmd('domaindelete', 'dd', domain_delete,
   719     'domaindelete': cmd('domaindelete', 'dd', domain_delete, 'fqdn [force]',
   723                       _(u'fqdn') + ' [force]',
       
   724                       _(u'delete the given domain and all its alias domains')),
   720                       _(u'delete the given domain and all its alias domains')),
   725     'domaininfo': cmd('domaininfo', 'di', domain_info, _(u'fqdn [details]'),
   721     'domaininfo': cmd('domaininfo', 'di', domain_info, 'fqdn [details]',
   726                       _(u'display information about the given domain')),
   722                       _(u'display information about the given domain')),
   727     'domainquota': cmd('domainquota', 'dq', domain_quota,
   723     'domainquota': cmd('domainquota', 'dq', domain_quota,
   728                        _(u'fqdn storage [messages]') + ' [force]',
   724                        'fqdn storage [messages] [force]',
   729                        _(u'update the quota limit of the specified domain')),
   725                        _(u'update the quota limit of the specified domain')),
   730     'domainservices': cmd('domainservices', 'ds', domain_services,
   726     'domainservices': cmd('domainservices', 'ds', domain_services,
   731                           _(u'fqdn [service ...]') + ' [force]',
   727                           'fqdn [service ...] [force]',
   732                           _(u'enables the specified services and disables all '
   728                           _(u'enables the specified services and disables all '
   733                             u'not specified services of the given domain')),
   729                             u'not specified services of the given domain')),
   734     'domaintransport': cmd('domaintransport', 'dt', domain_transport,
   730     'domaintransport': cmd('domaintransport', 'dt', domain_transport,
   735                            _(u'fqdn transport') + ' [force]',
   731                            'fqdn transport [force]',
   736                            _(u'update the transport of the specified domain')),
   732                            _(u'update the transport of the specified domain')),
   737     'listdomains': cmd('listdomains', 'ld', list_domains, _(u'[pattern]'),
   733     'listdomains': cmd('listdomains', 'ld', list_domains, '[pattern]',
   738                        _(u'list all domains / search domains by pattern')),
   734                       _(u'list all domains or search for domains by pattern')),
   739     # Relocated commands
   735     # Relocated commands
   740     'relocatedadd': cmd('relocatedadd', 'ra', relocated_add,
   736     'relocatedadd': cmd('relocatedadd', 'ra', relocated_add,
   741                         _(u'address newaddress'),
   737                         'address newaddress',
   742                         _(u'create a new record for a relocated user')),
   738                         _(u'create a new record for a relocated user')),
   743     'relocateddelete': cmd('relocateddelete', 'rd', relocated_delete,
   739     'relocateddelete': cmd('relocateddelete', 'rd', relocated_delete,
   744                            _(u'address'),
   740                            'address',
   745                            _(u'delete the record of the relocated user')),
   741                            _(u'delete the record of the relocated user')),
   746     'relocatedinfo': cmd('relocatedinfo', 'ri', relocated_info, _('address'),
   742     'relocatedinfo': cmd('relocatedinfo', 'ri', relocated_info, 'address',
   747                          _(u'print information about a relocated user')),
   743                          _(u'print information about a relocated user')),
   748     # cli commands
   744     # cli commands
   749     'configget': cmd('configget', 'cg', config_get, _(u'option'),
   745     'configget': cmd('configget', 'cg', config_get, 'option',
   750                      _('show the actual value of the configuration option')),
   746                      _('show the actual value of the configuration option')),
   751     'configset': cmd('configset', 'cs', config_set, _('option value'),
   747     'configset': cmd('configset', 'cs', config_set, 'option value',
   752                       _('set a new value for the configuration option')),
   748                       _('set a new value for the configuration option')),
   753     'configure': cmd('configure', 'cf', configure, _(u'[section]'),
   749     'configure': cmd('configure', 'cf', configure, '[section]',
   754                      _(u'start interactive configuration modus')),
   750                      _(u'start interactive configuration modus')),
   755     'listpwschemes': cmd('listpwschemes', 'lp', list_pwschemes, '',
   751     'listpwschemes': cmd('listpwschemes', 'lp', list_pwschemes, '',
   756                          _(u'lists all usable password schemes and password '
   752                          _(u'lists all usable password schemes and password '
   757                            u'encoding suffixes')),
   753                            u'encoding suffixes')),
   758     'help': cmd('help', 'h', help_, _(u'[subcommand]'),
   754     'help': cmd('help', 'h', help_, '[subcommand]',
   759                 _(u'show a help overview or help for the given subcommand')),
   755                 _(u'show a help overview or help for the given subcommand')),
   760     'version': cmd('version', 'v', version, '',
   756     'version': cmd('version', 'v', version, '',
   761                    _(u'show version and copyright information')),
   757                    _(u'show version and copyright information')),
   762     })
   758     })
   763 
   759