fission icon indicating copy to clipboard operation
fission copied to clipboard

Placement of `--verbose` should not matter

Open expede opened this issue 4 years ago • 1 comments

Reported by @bmann

Summary

Problem

The placemant of --verbose matters to the parser, which is confusing:

These are okay:

fission up --watch 
fission up --verbose

fission up --watch --verbose
fission --verbose up --watch 

This fails and shows the help text:

❯ fission up --verbose --watch
Invalid option `--watch'

Note that in all of the successful cases, these are grouped: up --watch, which is likely the subparser trying to find relevant items in a span?

Impact

It can be confusing/frustrating for users to need to group flags in a particular way. They don't know how the parser is organized!

Solution

See if we can get the parser to be more lenient with flags, or switch back to subtyping (with lenses) verbose on all parsers. We used to have it all lense-y, but it seemed that a lot of extra boilerplate versus treating it as a separate entity in the top-level parser.

expede avatar Jun 28 '21 22:06 expede

Also worth noting that --verbose order is reflected in the help text:

Usage: fission (SHORTCUT | COMMAND | --version) [-v|--verbose]

...and order does matter with nesting, such as this also failing command:

fission app --watch publish

Which I would actually not be surprised if it failed (which is does, but it also reads weird). The odd feeling thing about the --verbose case is that it feels like just another modifier, so it is surprising when this happens by simply swapping position with --watch.

expede avatar Jun 28 '21 22:06 expede