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 file secrets cat filePath.
write the stdin to a secret cat > secretPath or file cat > 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 to stdout.
Redirection into a secret path might not be possible with how commander parses inputs and how shell works, at least, not with the 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
Related #32
Tasks
Create a secrets cat command
If no arguments are provided it will take stdin and output to stdout.
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 > secretPath syntax. Failing that provide an option that handles that behaviour.
Specification
As per the #32 issue refactor, we need to implement a simplified
cat
command assecrets cat
.This will function identically to
cat
while omitting some of the options for now. It pretty much combines the functionality ofread
andwrite
commands along with the concatinationcat
is known for.Uses are
secrets cat secretPath
or filesecrets cat filePath
.stdin
to a secretcat > secretPath
or filecat > filePath
.stdin
will support pipes as well.secrets cat secretPath filePath secretPath/*
.Pretty much the the functionality boils down to two things
stdout
in the order they are specified.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
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
Related #32
Tasks
secrets cat
commandstdin
and output tostdout
.stdout
in the order they are provided.> secretPath
syntax. Failing that provide an option that handles that behaviour.