Closed
Description
Specification
As per the #32 issue refactor, we need to implement a simplified cat
command as secrets cat
.
This will function identically to cat
while omitting some of the options for now. It pretty much combines the functionality of read
and write
commands along with the concatination cat
is known for.
Uses are
- read the contents of a secret
secrets cat secretPath
or filesecrets cat filePath
. - write the
stdin
to a secretcat > secretPath
or filecat > filePath
.stdin
will support pipes as well. - concatenating files together in the output.
secrets cat secretPath filePath secretPath/*
.
Pretty much the the functionality boils down to two things
- Will output the contents of all specified files to
stdout
in the order they are specified. - If no files are specified then it will just output
stdin
tostdout
.
Redirection into a secret path might not be possible with how commander parses inputs and how shell works, at least, not with the (see comment)cat > secretPath
syntax. We'll need to prototype that. If it doesn't work, we'd have to use an option --redirect secretPath
to enable the functionality.
Additional context
Tasks
- Create a
secrets cat
command - If no arguments are provided it will take
stdin
and output tostdout
. - If arguments are provided it will write their contents to
stdout
in the order they are provided. - Support specifying normal files along side secret paths.
- Support specifying wildcards and possibly globbing for the paths.
Support redirecton into a secret using(see comment)secretPath
syntax. Failing that provide an option that handles that behaviour.