-
Notifications
You must be signed in to change notification settings - Fork 3
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
secrets env
needs --
to be passed twice to parse the command
#325
Comments
When printing [aryanj@matrix-34xx:~] polykey secrets env vault:SECRET -- echo 'hi' [
'/home/aryanj/Projects/polykey-cli/node_modules/.bin/ts-node',
'/home/aryanj/Projects/polykey-cli/src/polykey.ts',
'secrets',
'env',
'vault:another.txt',
'--',
'echo',
'hi'
] However, when printing the captured values by commander in the parser, we get the following as the vault paths. [
vault:SECRET
echo
hi
] This means that the arguments are captured properly, but commander is swallowing the singular I'd say the easiest solution would be to simply use commander for argument validation, but use the arguments present in |
Um |
You are right in assuming that [aryanj@matrix-34xx:~]$ which echo
echo: shell built-in command
[aryanj@matrix-34xx:~]$ which env
/run/current-system/sw/bin/env
[aryanj@matrix-34xx:~]$ env which echo
/run/current-system/sw/bin/echo
[aryanj@matrix-34xx:~]$ /run/current-system/sw/bin/echo testing
testing
[aryanj@matrix-34xx:~]$ env echo testing
testing So, we won't need to handle running shell commands with Other bash-inbuilt commands like [aryanj@matrix-34xx:~]$ which alias
alias: shell built-in command
[aryanj@matrix-34xx:~]$ env alias
env: 'alias': No such file or directory Sources |
Polykey-CLI#329 (comment) has seen some discussion to the underlying reason and how to fix it. Basically, we need to enable However, enabling the option breaks the command pass-through. This means that, if the This needs more work and investigation, so I'm leaving this as work for another PR. |
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.It is difficult to see which vault was the offender for commands containing multiple vaults, like
secrets
commands. For those commands at least, theErrorVaultsVaultUndefined
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 exist
Without reading the command properly, the user won't know that the offending vault was a typo in
another
.Additional context
Tasks
--
once in the CLI to run commands as opposed to twiceThe text was updated successfully, but these errors were encountered: