346 w_std(_("Generated password: %s") % gen_pass) |
346 w_std(_("Generated password: %s") % gen_pass) |
347 |
347 |
348 |
348 |
349 def user_delete(ctx): |
349 def user_delete(ctx): |
350 """delete the specified user""" |
350 """delete the specified user""" |
351 ctx.hdlr.user_delete(ctx.args.address.lower(), ctx.args.force) |
351 ctx.hdlr.user_delete(ctx.args.address.lower(), ctx.args.delete_home, |
|
352 ctx.args.force) |
352 |
353 |
353 |
354 |
354 def user_info(ctx): |
355 def user_info(ctx): |
355 """display information about the given address""" |
356 """display information about the given address""" |
356 address = ctx.args.address.lower() |
357 address = ctx.args.address.lower() |
904 ut.set_defaults(func=user_transport, scmd='usertransport') |
905 ut.set_defaults(func=user_transport, scmd='usertransport') |
905 |
906 |
906 ud = a('userdelete', aliases=('ud',), |
907 ud = a('userdelete', aliases=('ud',), |
907 help=_('delete the specified user'), |
908 help=_('delete the specified user'), |
908 epilog=fill(_('Use this subcommand to delete the account with the ' |
909 epilog=fill(_('Use this subcommand to delete the account with the ' |
909 'given address.\n\nIf there are one or more aliases with an ' |
910 'given address.\n\nWhen the --delete-home option is present, ' |
910 'identical destination address, vmm will abort the requested ' |
911 'vmm will also delete the account\'s home directory. This ' |
911 'operation and show an error message. To prevent this, ' |
912 'overrides the account.delete_directory setting of vmm.cfg.\n\n' |
912 'give the optional argument --force.')), |
913 'If there are one or more aliases with an identical ' |
|
914 'destination address, vmm will abort the requested operation ' |
|
915 'and show an error message. To prevent this, give the optional ' |
|
916 'argument --force.')), |
913 formatter_class=RawDescriptionHelpFormatter) |
917 formatter_class=RawDescriptionHelpFormatter) |
914 ud.add_argument('address', |
918 ud.add_argument('address', |
915 help=_("an account's e-mail address (local-part@fqdn)")) |
919 help=_("an account's e-mail address (local-part@fqdn)")) |
|
920 ud.add_argument('--delete-home', action='store_true', |
|
921 help=_("delete the account's home directory")) |
916 ud.add_argument('--force', action='store_true', |
922 ud.add_argument('--force', action='store_true', |
917 help=_('also delete assigned alias addresses')) |
923 help=_('also delete assigned alias addresses')) |
918 ud.set_defaults(func=user_delete, scmd='userdelete') |
924 ud.set_defaults(func=user_delete, scmd='userdelete') |
919 |
925 |
920 ### |
926 ### |