Changed addkey arguments

This commit is contained in:
Dennis Schwerdel 2017-05-11 09:36:44 +02:00
parent dbfd8849c4
commit 1cd58e180d
4 changed files with 16 additions and 8 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ restored
excludes excludes
._* ._*
.~* .~*
docs/logo

View File

@ -3,6 +3,11 @@
This project follows [semantic versioning](http://semver.org). This project follows [semantic versioning](http://semver.org).
### UNRELEASED
* [modifed] Changed order of arguments in `addkey` to match src-dst scheme
* [fixed] Fixed `addkey` subcommand
### v0.3.1 (2017-05-09) ### v0.3.1 (2017-05-09)
* [added] Derive key pairs from passwords * [added] Derive key pairs from passwords
* [modified] Added root repository to exclude list * [modified] Added root repository to exclude list

View File

@ -3,7 +3,7 @@ zvault-addkey(1) -- Add a key pair to the repository
## SYNOPSIS ## SYNOPSIS
`zvault addkey [OPTIONS] <REPO> [FILE]` `zvault addkey [OPTIONS] [FILE] <REPO>`
## DESCRIPTION ## DESCRIPTION
@ -14,7 +14,8 @@ If `FILE` is given, the key pair is read from the file and added to the
repository. repository.
If `--generate` is set, a new key pair is generated, printed to console and If `--generate` is set, a new key pair is generated, printed to console and
added to the repository. added to the repository. If `--password` is also set, the key pair will be
derived from the given password instead of creating a random one.
If `--default` is set, encryption will be enabled (if not already) and the new If `--default` is set, encryption will be enabled (if not already) and the new
key will be set as default encryption key. key will be set as default encryption key.
@ -35,6 +36,7 @@ key will be set as default encryption key.
* `-p`, `--password <PASSWORD>`: * `-p`, `--password <PASSWORD>`:
Derive the key pair from the given password instead of randomly creating it. Derive the key pair from the given password instead of randomly creating it.
This setting requires that `--generate` is set too.
* `-h`, `--help`: * `-h`, `--help`:

View File

@ -405,14 +405,14 @@ pub fn parse() -> Result<(LogLevel, Arguments), ErrorCode> {
.arg(Arg::from_usage("[FILE] 'Destination file for the keypair'"))) .arg(Arg::from_usage("[FILE] 'Destination file for the keypair'")))
.subcommand(SubCommand::with_name("addkey").about("Add a key pair to the repository") .subcommand(SubCommand::with_name("addkey").about("Add a key pair to the repository")
.arg(Arg::from_usage("-g --generate 'Generate a new key pair'") .arg(Arg::from_usage("-g --generate 'Generate a new key pair'")
.conflicts_with_all(&["FILE", "PASSWORD"])) .conflicts_with("FILE"))
.arg(Arg::from_usage("[set_default] --default -d 'Set the key pair as default'")) .arg(Arg::from_usage("[set_default] --default -d 'Set the key pair as default'"))
.arg(Arg::from_usage("-p --password [PASSWORD] 'Derive the key pair from the given password'") .arg(Arg::from_usage("-p --password [PASSWORD] 'Derive the key pair from the given password'")
.conflicts_with("FILE")) .requires("generate"))
.arg(Arg::from_usage("<REPO> 'Path of the repository'")
.validator(|val| validate_repo_path(val, true, Some(false), Some(false))))
.arg(Arg::from_usage("[FILE] 'File containing the keypair'") .arg(Arg::from_usage("[FILE] 'File containing the keypair'")
.validator(validate_existing_path))) .validator(validate_existing_path))
.arg(Arg::from_usage("<REPO> 'Path of the repository'")
.validator(|val| validate_repo_path(val, true, Some(false), Some(false)))))
.subcommand(SubCommand::with_name("algotest").about("Test a specific algorithm combination") .subcommand(SubCommand::with_name("algotest").about("Test a specific algorithm combination")
.arg(Arg::from_usage("[bundle_size] --bundle-size [SIZE] 'Set the target bundle size in MiB'") .arg(Arg::from_usage("[bundle_size] --bundle-size [SIZE] 'Set the target bundle size in MiB'")
.default_value(DEFAULT_BUNDLE_SIZE_STR).validator(validate_num)) .default_value(DEFAULT_BUNDLE_SIZE_STR).validator(validate_num))