-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
developmentStandard developmentStandard development
Description
Specification
When running the secrets env command in the tests, we only need to pass -- once, and that will delimit the commands and the vault names.
However, this is not the case when running the program on the CLI, as we need to write -- twice to get it to work. For example, the following will work in the tests but not in CLI.
# In jest
[aryanj@matrix-34xx:~]$ polykey secrets env vault -- echo 'hi'
TESTING='top secret'
hi
# In shell
[aryanj@matrix-34xx:~]$ polykey secrets env vault -- echo 'hi'
ErrorPolykeyRemote: Remote error from RPC call
...
cause: ErrorVaultsVaultUndefined: Vault does not exist
[aryanj@matrix-34xx:~]$ polykey secrets env vault -- -- echo 'hi'
TESTING='top secret'
hiIt is difficult to see which vault was the offender for commands containing multiple vaults, like secrets commands. For those commands at least, the ErrorVaultsVaultUndefined should also return the name of the offending vault. For example, a command like this can be difficult to find the invalid vault.
[aryanj@matrix-34xx:~]$ polykey secrets cat test.vault:file1 anothr.vault:file2
ErrorPolykeyRemote: Remote error from RPC call
...
cause: ErrorVaultsVaultUndefined: Vault does not existWithout reading the command properly, the user won't know that the offending vault was a typo in another.
Additional context
- Needing
program.enablePositionalArgumentsenabled to usecommand.passThroughOptions, but enabling positional arguments breaks the commands: Polykey-CLI#325 and Polykey-CLI#329 (comment) - Upstream discussion on a solution without needing to enable positional arguments: commander.js#2281
Tasks
- Allow
--once in the CLI to run commands as opposed to twice - Provide feedback by listing which vault was incorrect
Metadata
Metadata
Assignees
Labels
developmentStandard developmentStandard development