Skip to content

fix(Cabal, cabal-install): List global flags in the help text of every command - #12299

Open
zlonast wants to merge 4 commits into
haskell:masterfrom
zlonast:zlonast/store-dir
Open

fix(Cabal, cabal-install): List global flags in the help text of every command#12299
zlonast wants to merge 4 commits into
haskell:masterfrom
zlonast:zlonast/store-dir

Conversation

@zlonast

@zlonast zlonast commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

fix: #7587

Global options of cabal, such as --store-dir, were only documented in the
help of the cabal program itself (cabal --help) but not in the help text of
the individual commands that they affect, e.g. cabal build --help. This made
options like --store-dir hard to discover.

Now every command's help text ends with a Global flags: section listing the
same global options as the top-level help, together with a note that these
options must be given /before/ the command, e.g. cabal --store-dir=DIR build.

Additionally, cabal help COMMAND now shows exactly the same text as
cabal COMMAND --help, including the new global flags section and no longer
the "You can edit the cabal configuration file..." epilogue of the global help.

  Examples:
    cabal build
      Build the package in the current directory or all packages in the project
    cabal build pkgname
      Build the package named pkgname in the project
    cabal build ./pkgfoo
      Build the package in the ./pkgfoo directory
    cabal build cname
      Build the component named cname in the project
    cabal build cname --enable-profiling
      Build the component in profiling mode (including dependencies as needed)
+
+Global flags:
+ -V, --version                # Print version information
+ --full-version               # Print full version information with git
+                                revision (if available) and compiler
+ --numeric-version            # Print just the version number
+ --config-file=FILE           # Set an alternate location for the config file
+ --ignore-expiry              # Ignore expiry dates on signed metadata (use
+                                only in exceptional circumstances)
+ --http-transport=HttpTransport
+                              # Set a transport for http(s) requests. Accepts
+                                'curl', 'wget', 'powershell', and
+                                'plain-http'. (default: 'curl')
+ --store-dir=DIR              # The location of the build store
+ --active-repositories=REPOS  # The active package repositories (set to
+                                ':none' to disable all repositories)
+
+Global flags must be given before the command, e.g.
+`cabal --store-dir=DIR build`.

Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@zlonast zlonast added re: help-text Concerning option --help and hints given to the user re: store-dir On local nix store (option `--store-dir`) re: user experience User experience (UX) issue attention: needs-review labels Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention: needs-review re: help-text Concerning option --help and hints given to the user re: store-dir On local nix store (option `--store-dir`) re: user experience User experience (UX) issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option --store-dir not mentioned in help text of build

2 participants