#21 Overhaul CLI
Opened 3 years ago by qulogic. Modified 3 years ago

I don't really like the way the command-line arguments are specified right now. Everything is an optional flag which requires writing out a redundant argument name. This would be even worse with #4. Also, urfave/cli doesn't seem to follow POSIX semantics, which is a bit annoying.

I'd rather the CLI look something like: golist <command> <package-path> [<package path> ...] where <command> is one of the original flags that specified output modes. All the other flags could remain optional.

This could maybe be done with pflag instead for optional things and just switching commands ourselves. Or maybe using cobra. Probably depends on how heavy these things are.


@eclipseo Please play a little with modist and tell us if it is better. I tried to fix the CLI interface.

cobra is difficult to use in a core utility like golist. It has lots of requirements, so bootsrapping a Go stack that required cobra to work would be quite difficult.

True, cobra uses quite a bit; pflag has no dependencies though, which would be even better than urfave/cli.

Login to comment on this ticket.

Metadata