def rm(ctx, pass_name, recursive, force):
"""Remove the password names `pass-name` from the password store.
This command is alternatively named `remove` or `delete`. If
`--recursive` or `-r` is specified, delete pass-name recursively
if it is a directory. If `--force` or `-f` is specified, do not
interactively prompt before removal.
"""
try:
ctx.obj.remove_path(pass_name, recursive, force)
except StoreNotInitialisedError:
click.echo(MSG_STORE_NOT_INITIALISED_ERROR)
return 1
except FileNotFoundError:
click.echo('{0} is not in the password store.'.format(pass_name))
return 1
except PermissionError:
click.echo(MSG_PERMISSION_ERROR)
return 1
评论列表
文章目录