Open nick1udwig opened 9 months ago
we use clap for some of the arg parsing: can we get that usage information for those that we do?
See, e.g., https://github.com/kinode-dao/kit/blob/ed92ceb8e3026c865fbf2746dfcbafaaeed4ae9b/src/main.rs#L609 https://docs.rs/clap/latest/clap/struct.Command.html#method.render_usage
If there is a failure case, we need to be providing as much and as accurate as possible actionable information to users. This is a general goal, not specific to this case! If there is an error message, we need to carefully think about what cases the user will see this and if the message we are printing will be informative to them. If it will not be: how can we make it informative to them?
Worst case scenario: it gives them info they can give to one of us to debug.
Best case scenario, and what we should be aiming for always: they can see what they did wrong and correct it.
can you point out something specific? script error handling is pretty good across the board
We should print usage whenever we get bad input, not just for empty input.
One specific comment and one general comment.
Specific comment
alias
can be used in unexpected ways that would ideally error out differently, e.g.:Alias can be assigned to any process; only fails when that alias is called
Current behavior:
Desired behavior: Error when the alias is set and provide non-"nerdview" errors. E.g. in first case it'd be nice to say something like "package
echo:sys
does not exist" and in the second something like "given process is not a script; can only alias scripts"Different error print if alias DNE
Current behavior:
Desired behavior: Print
alias does not exist
if an alias does not exist.General comment
It'd be nice if scripts printed out usage information if they can't parse args. Some are currently more helpful than others, but in general it'd be great to print usage if given no args. E.g., we use
clap
for some of the arg parsing: can we get that usage information for those that we do?Current behavior:
FYI @tadad