flow-cli icon indicating copy to clipboard operation
flow-cli copied to clipboard

Detect misuse in keys > decode command

Open austinkline opened this issue 2 years ago • 1 comments

Issue To Be Solved

Error messages output when using flow keys decode ... are unclear, leading to misuse of the command

context

image image

(Optional): Suggest A Solution

@turbolent suggested we could detect if a given input doesn't start with what it should. For instance, in the case of a pem, if the input doesn't begin with -----BEGIN, it is malformed and the user can be informed that they are likely not using the correct input.

Personally, I think that detecting when an input looks like a file, but the --from-file flag wasn't given, the cli should ask if the user meant to include --from-file

(Optional): Context

Someone in the flow discord wasn't sure how to use this command, they were missing a flag

austinkline avatar Oct 20 '23 14:10 austinkline

I think detecting input is very good, even we can check if it is filename. Also probably stdin support would be good idea.

bluesign avatar Oct 20 '23 15:10 bluesign