idris2-pack icon indicating copy to clipboard operation
idris2-pack copied to clipboard

Feature Request: use a more intuitive option order

Open subterfugue opened this issue 2 years ago • 2 comments

Currently, for something like pack repl, you have options like --rlwrap which only apply to that command; and the way you use it is via pack --rlwrap repl, which for people who have used CLIs for a long time might look weird and unintuitive. My first try with this was pack repl --rlwrap, which actually isn't valid.

But also another issue of this, is that since --rlwrap is a valid argument for pack itself, you can use it with any other command; which could be slightly erroneous, but pack accepts it for other commands like pack --rlwrap package-path, while not allowing invalid flags like pack --onetwothree package-path.

subterfugue avatar Jul 12 '22 03:07 subterfugue

Could you please write a short spec describing the order of commands and arguments pack should accept? In order to make this happen we not only need to change how commands and arguments are being parsed but also how tab completion can be adjusted to the new ordering.

stefan-hoeck avatar Jul 14 '22 16:07 stefan-hoeck

I think it should be pack [--options-for-pack-only] command [--options-for-command-only] But I'm currently not at my home so I don't have a computer, let alone one that has pack, so I am unable to test. I'll be back in 3 days or so; but either way, I think that works well enough

subterfugue avatar Jul 14 '22 19:07 subterfugue

This has been open for a long time, and as I said, I'm not the one going to change the way we handle command line options without the help from contributors. Feel free to reopen if you plan to start working on this or you can provide detailed guidance about how to proceed here.

stefan-hoeck avatar Oct 09 '23 18:10 stefan-hoeck