VirtualMailManager/cli/subcommands.py
branchv0.7.x
changeset 756 139ced0fea1e
parent 754 8363ea6240a5
equal deleted inserted replaced
755:e99e4fc62a5f 756:139ced0fea1e
   347         w_std(_("Generated password: %s") % gen_pass)
   347         w_std(_("Generated password: %s") % gen_pass)
   348 
   348 
   349 
   349 
   350 def user_delete(ctx):
   350 def user_delete(ctx):
   351     """delete the specified user"""
   351     """delete the specified user"""
   352     ctx.hdlr.user_delete(ctx.args.address.lower(), ctx.args.delete_home,
   352     ctx.hdlr.user_delete(ctx.args.address.lower(), ctx.args.delete_directory,
   353                          ctx.args.force)
   353                          ctx.args.force)
   354 
   354 
   355 
   355 
   356 def user_info(ctx):
   356 def user_info(ctx):
   357     """display information about the given address"""
   357     """display information about the given address"""
   910     ut.set_defaults(func=user_transport, scmd='usertransport')
   910     ut.set_defaults(func=user_transport, scmd='usertransport')
   911 
   911 
   912     ud = a('userdelete', aliases=('ud',),
   912     ud = a('userdelete', aliases=('ud',),
   913            help=_('delete the specified user'),
   913            help=_('delete the specified user'),
   914            epilog=fill(_('Use this subcommand to delete the account with the '
   914            epilog=fill(_('Use this subcommand to delete the account with the '
   915                'given address.\n\nWhen the --delete-home option is present, '
   915                'given address.\n\nWhen the --delete-directory option is '
   916                'vmm will also delete the account\'s home directory. This '
   916                'present, vmm will also delete the account\'s home directory. '
   917                'overrides the account.delete_directory setting of vmm.cfg.\n\n'
   917                'This overrides the account.delete_directory setting of '
   918                'If there are one or more aliases with an identical '
   918                'vmm.cfg.\n\nIf there are one or more aliases with an '
   919                'destination address, vmm will abort the requested operation '
   919                'identical destination address, vmm will abort the requested '
   920                'and show an error message. To prevent this, give the optional '
   920                'operation and show an error message. To prevent this, give '
   921                'argument --force.')),
   921                'the optional argument --force.')),
   922            formatter_class=RawDescriptionHelpFormatter)
   922            formatter_class=RawDescriptionHelpFormatter)
   923     ud.add_argument('address',
   923     ud.add_argument('address',
   924                     help=_("an account's e-mail address (local-part@fqdn)"))
   924                     help=_("an account's e-mail address (local-part@fqdn)"))
   925     ud.add_argument('--delete-home', action='store_true',
   925     ud.add_argument('--delete-directory', action='store_true',
   926                     help=_("delete the account's home directory"))
   926                     help=_("delete the account's home directory"))
   927     ud.add_argument('--force', action='store_true',
   927     ud.add_argument('--force', action='store_true',
   928                     help=_('also delete assigned alias addresses'))
   928                     help=_('also delete assigned alias addresses'))
   929     ud.set_defaults(func=user_delete, scmd='userdelete')
   929     ud.set_defaults(func=user_delete, scmd='userdelete')
   930 
   930