Skip to content

Improve pws subcommand #139

@robinkrahl

Description

@robinkrahl

Last week, I've used the PWS functionality for the first time with real data. I had some issues with our current PWS commands:

  • The user has to provide the password as a CLI argument. This might lead to leaks via the history file, logs or the process list.
  • There are three typical use cases:
    1. Adding a new site. Currently, I have to check which slots are currently programmed (pws status), keep track of the first unprogrammed slot and then call pws set.
    2. Updating existing information. Currently, this requires me to re-enter all information for the pws set command instead of just listing the information to update.
    3. Deleting a site. This works fine.

So I suggest to replace the current pws set command with:

  • pws set [--overwrite] <slot> <name> <login> [<password>|-]. If the password is set to -, it is read from stdin. If it is not set, it is prompted from the user. Unless --overwrite (or --force?) is set, this makes sure that the slot is currently unprogrammed to avoid accidental data loss.
  • pws add <name> <login> [<password>|-]. The same as pws set, but it queries the first unprogrammed slot and writes the data to this slot.
  • pws update <slot> [--name <name>] [--login <login>] [--password <password>]. Overwrites the given data on the given slot without changing the other fields.

If we want to be even more interactive, we could also make the slot, name and login arguments optional and prompt them from the user if not set.

@d-e-s-o What do you think?


Tracking:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions