def init(ctx, gpg_ids, path):
"""Initialize new password storage and use `gpg-id` for encryption.
Mutliple gpg-ids may be specified, in order to encrypt each
password with multiple ids. This command must be run first before
a password store can be used. If the specified `gpg-id` is
different from the ye used in any existing files, these files will
be reencrypted to use the new id. Note that use of an gpg agent
is recommended so that the batch decryption does not require as
much user intervention. If `--path` or `-p` is specified, along
with an argument, a specific gpg-id or a set of gpg-ids is
assigned for that specific sub folder of the password store. If
only the gpg-id is given, and it is an empty string then the
current `.gpg-id` file for the specfified `sub-folder` (or root if
unspecified) is removed.
"""
try:
ctx.obj.init_store(list(gpg_ids), path=path)
except PermissionError:
click.echo(MSG_PERMISSION_ERROR)
return 1
click.echo('Password store initialised for {0}.'
.format(','.join(gpg_ids)))
评论列表
文章目录