Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gopass generate - better help and error messages #1911

Closed
leogott opened this issue Apr 22, 2021 · 1 comment · Fixed by #1912
Closed

gopass generate - better help and error messages #1911

leogott opened this issue Apr 22, 2021 · 1 comment · Fixed by #1912
Labels
ux User experience / User Interface related
Milestone

Comments

@leogott
Copy link

leogott commented Apr 22, 2021

Summary

The text shown by command gopass help generate is

  • difficult to understand and
  • doesn't explain the usage of [arguments...] at all.
  • Additionally the error messages don't really help either.

Problem a

gopass help generate

NAME:
gopass.exe generate - Generate a new password

better: Generate a new password and write it into a secret.

USAGE:
gopass.exe generate [command options] [arguments...]

See below

DESCRIPTION:
Generate a new password of the specified length, optionally with no symbols. Alternatively, a xkcd style password can be generated (https://xkcd.com/936/). Optionally put it on the clipboard and clear clipboard after 45 seconds. Prompt before overwriting existing password unless forced. It will replace only the first line of an existing file with a new password.

I suggest to change it to something more succinct and along the lines of:

Dialog to generate a new password and write it into a new or existing secret. By default, the new password will replace the first line of an existing secret (unless it's a key-value-pair?). Supports options of pwgen and show listed below.

[...]

Problem b

PS > gopass generate example -c
How long should the password be? (q to abort) [24]:
✅ Password for entry "example:-c" generated
Not printing secrets by default. Use 'gopass show example:-c' to display the password.

Error: failed to set key "-c" of "example": entry is not in the password store

(Note: This Error message is mostly helpful)
The intention was to generate a password for a new secret, and to immediately copy it to the clipboard.
The operation fails because the -c comes after an argument. This may be inobvious to a user (me), as option and argument are words with very similar meaning. Listing the possible arguments in the the Usage would mitigate this

Say: gopass.exe generate [command options] [secret [key [length ...?]]]

Problem c

PS > gopass generate Account/example.com 16 -c results in

Error: password length must be a number
Again, an option follows an argument. So gopass attempts to generate a password for the key 16 into Account/example.com and complains about -c not being a number.

It would be very helpful if gopass informed the user of what generate recognized as arguments, if any were provided.

Environment

  • OS: Windows 10 Pro
  • OS version: 19041.928
  • gopass Version: gopass 1.12.5+1878ea5df0c58dadc215342f3a7d024cd8378174
  • Installation method: scoop

Additional context

@dominikschulz dominikschulz added the ux User experience / User Interface related label Apr 24, 2021
@dominikschulz dominikschulz added this to the 1.x.x milestone Apr 24, 2021
dominikschulz added a commit to dominikschulz/gopass that referenced this issue Apr 24, 2021
This commit adds the ArgsUsage to most commands to better illustrate the
intended usage of the different commands.

RELEASE_NOTES=[ENHANCEMENT] Add better usage instructions

Fixes gopasspw#1911

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
@dominikschulz
Copy link
Member

Thank you very much for the detail report and the suggestions.

dominikschulz added a commit that referenced this issue May 1, 2021
This commit adds the ArgsUsage to most commands to better illustrate the
intended usage of the different commands.

RELEASE_NOTES=[ENHANCEMENT] Add better usage instructions

Fixes #1911

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
kpitt pushed a commit to kpitt/gopass that referenced this issue Jul 21, 2022
This commit adds the ArgsUsage to most commands to better illustrate the
intended usage of the different commands.

RELEASE_NOTES=[ENHANCEMENT] Add better usage instructions

Fixes gopasspw#1911

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux User experience / User Interface related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants