haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.6k stars 689 forks source link

Global flags are in the way #9783

Open philderbeast opened 5 months ago

philderbeast commented 5 months ago

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?

geekosaur commented 5 months ago

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.

philderbeast commented 5 months ago

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.