cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Global flags are in the way

Open philderbeast opened this issue 1 year ago • 2 comments

Lots of commands take targets.

Originally posted by @philderbeast in https://github.com/haskell/cabal/issues/9744#issuecomment-1980928890

I thought of maybe listing the commands that take targets but quickly gave up, not wanting to scroll up past 6 pages of global flags to see whether the command takes [TARGETS];

$ cabal build --help
Compile targets within the project.

Usage: cabal build [TARGETS] [FLAGS]

Description ...

Flags for build (includes global flags):
...
1st page of flags
2nd "    "   "
3rd "    "   "
4th "    "   "
5th "    "   "
6th "    "   "

Examples ...

Can we not show the global flags by default?

philderbeast avatar Mar 06 '24 14:03 philderbeast

A common pattern is to list the global flags in their own section. For individual commands this might be output after the command-specific flags, or might point the user to a --help-globals option.

geekosaur avatar Mar 06 '24 14:03 geekosaur

Yes stack has a separate command for raising the living dead of global flags;

Command 'stack --help' for global options that apply to all subcommands.

philderbeast avatar Mar 06 '24 14:03 philderbeast