From 4458611ed220db8f31992940b32905c2b5167cac Mon Sep 17 00:00:00 2001 From: Ilya Baryshnikov Date: Sun, 30 Aug 2026 09:50:03 +0300 Subject: [PATCH 1/4] add test --- .../global-flags-in-command-help.out | 2 ++ .../global-flags-in-command-help.test.hs | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.out create mode 100644 cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.test.hs diff --git a/cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.out b/cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.out new file mode 100644 index 00000000000..0baa8e62414 --- /dev/null +++ b/cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.out @@ -0,0 +1,2 @@ +# cabal build +# cabal --help diff --git a/cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.test.hs b/cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.test.hs new file mode 100644 index 00000000000..e320d93d79b --- /dev/null +++ b/cabal-testsuite/PackageTests/Help/GlobalFlagsInCommandHelp/global-flags-in-command-help.test.hs @@ -0,0 +1,15 @@ +import Test.Cabal.Prelude + +main = cabalTest $ do + -- The help of an individual command should mention the global flags. + buildHelp <- cabal' "build" ["--help"] + assertOutputContains "Global flags:" buildHelp + assertOutputContains "--store-dir=DIR" buildHelp + + -- The same help text is reachable via `cabal help build`. + buildHelp2 <- cabal_raw' ["help", "build"] Nothing + assertOutputContains "--store-dir=DIR" buildHelp2 + + -- For comparison, the global help has always listed `--store-dir`. + globalHelp <- cabal' "--help" [] + assertOutputContains "--store-dir=DIR" globalHelp From b58dbef49dc215b95e081339390a22aa9a9eea9d Mon Sep 17 00:00:00 2001 From: Ilya Baryshnikov Date: Sun, 30 Aug 2026 09:50:17 +0300 Subject: [PATCH 2/4] fix doc --- doc/cmd-v1-help/bench.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/build.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/clean.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/configure.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/copy.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/freeze.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/gen-bounds.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/haddock.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/install.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/reconfigure.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/register.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/repl.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/run.txt | 19 +++++++++++++++++++ doc/cmd-v1-help/test.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/bench.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/build.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/clean.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/configure.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/exec.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/fetch.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/freeze.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/gen-bounds.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/get.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/haddock-project.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/haddock.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/hscolour.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/info.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/init.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/install.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/list-bin.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/list.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/outdated.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/path.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/repl.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/report.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/run.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/sdist.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/target.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/test.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/unpack.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/update.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/upload.txt | 19 +++++++++++++++++++ doc/cmd-v2-help/user-config.txt | 19 +++++++++++++++++++ doc/cmd-v2-hidden-help/act-as-setup.txt | 19 +++++++++++++++++++ doc/cmd-v2-hidden-help/format.txt | 19 +++++++++++++++++++ doc/cmd-v2-hidden-help/man.txt | 19 +++++++++++++++++++ 46 files changed, 874 insertions(+) diff --git a/doc/cmd-v1-help/bench.txt b/doc/cmd-v1-help/bench.txt index d4e7d33b17a..e1547a6fb64 100644 --- a/doc/cmd-v1-help/bench.txt +++ b/doc/cmd-v1-help/bench.txt @@ -54,3 +54,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/build.txt b/doc/cmd-v1-help/build.txt index d8ef015e678..74984b15e03 100644 --- a/doc/cmd-v1-help/build.txt +++ b/doc/cmd-v1-help/build.txt @@ -41,3 +41,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/clean.txt b/doc/cmd-v1-help/clean.txt index 5ffb5fdea79..96cda9dacbd 100644 --- a/doc/cmd-v1-help/clean.txt +++ b/doc/cmd-v1-help/clean.txt @@ -24,3 +24,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/configure.txt b/doc/cmd-v1-help/configure.txt index 7059ef5d400..52909cc7f8d 100644 --- a/doc/cmd-v1-help/configure.txt +++ b/doc/cmd-v1-help/configure.txt @@ -224,3 +224,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/copy.txt b/doc/cmd-v1-help/copy.txt index b446d91b46b..ae628ed8cf6 100644 --- a/doc/cmd-v1-help/copy.txt +++ b/doc/cmd-v1-help/copy.txt @@ -29,3 +29,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/freeze.txt b/doc/cmd-v1-help/freeze.txt index 2357900bdf0..7b6b742cf2a 100644 --- a/doc/cmd-v1-help/freeze.txt +++ b/doc/cmd-v1-help/freeze.txt @@ -84,3 +84,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/gen-bounds.txt b/doc/cmd-v1-help/gen-bounds.txt index ed0a72ab8f7..54b3ab9ae58 100644 --- a/doc/cmd-v1-help/gen-bounds.txt +++ b/doc/cmd-v1-help/gen-bounds.txt @@ -20,3 +20,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/haddock.txt b/doc/cmd-v1-help/haddock.txt index ab52ac9a910..1fd151b8ff0 100644 --- a/doc/cmd-v1-help/haddock.txt +++ b/doc/cmd-v1-help/haddock.txt @@ -58,3 +58,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/install.txt b/doc/cmd-v1-help/install.txt index b4937a719cc..73e31af9f10 100644 --- a/doc/cmd-v1-help/install.txt +++ b/doc/cmd-v1-help/install.txt @@ -394,3 +394,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/reconfigure.txt b/doc/cmd-v1-help/reconfigure.txt index 15d821d1358..630ad967163 100644 --- a/doc/cmd-v1-help/reconfigure.txt +++ b/doc/cmd-v1-help/reconfigure.txt @@ -220,3 +220,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/register.txt b/doc/cmd-v1-help/register.txt index 329aff4e3ea..03796b9700e 100644 --- a/doc/cmd-v1-help/register.txt +++ b/doc/cmd-v1-help/register.txt @@ -31,3 +31,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/repl.txt b/doc/cmd-v1-help/repl.txt index 2f10e0b4b8f..32bef49b87f 100644 --- a/doc/cmd-v1-help/repl.txt +++ b/doc/cmd-v1-help/repl.txt @@ -51,3 +51,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/run.txt b/doc/cmd-v1-help/run.txt index b1b0a8f85f3..eba6a4984b0 100644 --- a/doc/cmd-v1-help/run.txt +++ b/doc/cmd-v1-help/run.txt @@ -40,3 +40,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v1-help/test.txt b/doc/cmd-v1-help/test.txt index 6732042f66a..5dc0c419cd4 100644 --- a/doc/cmd-v1-help/test.txt +++ b/doc/cmd-v1-help/test.txt @@ -70,3 +70,22 @@ case with the nix-style commands. For more information, see: https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html + +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`. diff --git a/doc/cmd-v2-help/bench.txt b/doc/cmd-v2-help/bench.txt index c5ba5a99f02..d7273cee3c7 100644 --- a/doc/cmd-v2-help/bench.txt +++ b/doc/cmd-v2-help/bench.txt @@ -381,3 +381,22 @@ Examples: Run the benchmark named cname cabal bench cname -O2 Run the benchmark built with '-O2' (including local libs used) + +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`. diff --git a/doc/cmd-v2-help/build.txt b/doc/cmd-v2-help/build.txt index c4d2f57a62f..bc545c3ad64 100644 --- a/doc/cmd-v2-help/build.txt +++ b/doc/cmd-v2-help/build.txt @@ -383,3 +383,22 @@ Examples: 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`. diff --git a/doc/cmd-v2-help/clean.txt b/doc/cmd-v2-help/clean.txt index 159ba0e2a12..8a3fe500590 100644 --- a/doc/cmd-v2-help/clean.txt +++ b/doc/cmd-v2-help/clean.txt @@ -20,3 +20,22 @@ Flags for clean: files (default dist) -s, --save-config # Save configuration, only remove build artifacts + +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`. diff --git a/doc/cmd-v2-help/configure.txt b/doc/cmd-v2-help/configure.txt index c97f66063b1..f0717fd60ea 100644 --- a/doc/cmd-v2-help/configure.txt +++ b/doc/cmd-v2-help/configure.txt @@ -390,3 +390,22 @@ Examples: cabal configure Reset the local configuration to empty. To check that the project configuration works, use 'cabal build'. + +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`. diff --git a/doc/cmd-v2-help/exec.txt b/doc/cmd-v2-help/exec.txt index ea4368e9cd8..b8678d4775a 100644 --- a/doc/cmd-v2-help/exec.txt +++ b/doc/cmd-v2-help/exec.txt @@ -371,3 +371,22 @@ Flags for exec: (relative to the project directory when relative) --project-file-parser=PARSER # Set the parser to use for the project file + +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`. diff --git a/doc/cmd-v2-help/fetch.txt b/doc/cmd-v2-help/fetch.txt index b66044ab234..58d4bcca5f1 100644 --- a/doc/cmd-v2-help/fetch.txt +++ b/doc/cmd-v2-help/fetch.txt @@ -74,3 +74,22 @@ Flags for fetch: # Require these packages to have constraints on them if they are to be selected (default: none). + +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`. diff --git a/doc/cmd-v2-help/freeze.txt b/doc/cmd-v2-help/freeze.txt index 64269ce7f8e..adf676a9065 100644 --- a/doc/cmd-v2-help/freeze.txt +++ b/doc/cmd-v2-help/freeze.txt @@ -385,3 +385,22 @@ Examples: Check what a solution with the given constraints would look like cabal freeze --constraint="aeson < 1" Freeze a solution using the given constraints + +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`. diff --git a/doc/cmd-v2-help/gen-bounds.txt b/doc/cmd-v2-help/gen-bounds.txt index 8764aac5bda..5513a103975 100644 --- a/doc/cmd-v2-help/gen-bounds.txt +++ b/doc/cmd-v2-help/gen-bounds.txt @@ -368,3 +368,22 @@ Examples: Generate bounds for the package named pkgname in the project cabal gen-bounds ./pkgfoo Generate bounds for the package in the ./pkgfoo directory + +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`. diff --git a/doc/cmd-v2-help/get.txt b/doc/cmd-v2-help/get.txt index 8f4331e5cf4..561913c0fb5 100644 --- a/doc/cmd-v2-help/get.txt +++ b/doc/cmd-v2-help/get.txt @@ -37,3 +37,22 @@ Examples: Download the latest stable version of hlint; cabal get lens --source-repository=head Download the source repository of lens (i.e. git clone from github). + +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`. diff --git a/doc/cmd-v2-help/haddock-project.txt b/doc/cmd-v2-help/haddock-project.txt index bc92c06f752..805f876997d 100644 --- a/doc/cmd-v2-help/haddock-project.txt +++ b/doc/cmd-v2-help/haddock-project.txt @@ -39,3 +39,22 @@ Flags for haddock-project: use "" to prevent splitting) --haddock-options=OPTS # Give extra options to haddock (split on spaces, use "" to prevent splitting) + +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`. diff --git a/doc/cmd-v2-help/haddock.txt b/doc/cmd-v2-help/haddock.txt index 2e5046e47f7..d49b70d87d8 100644 --- a/doc/cmd-v2-help/haddock.txt +++ b/doc/cmd-v2-help/haddock.txt @@ -380,3 +380,22 @@ Flags for haddock: Examples: cabal haddock pkgname Build documentation for the package named pkgname + +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`. diff --git a/doc/cmd-v2-help/hscolour.txt b/doc/cmd-v2-help/hscolour.txt index f307d39229a..da1ebcfbd97 100644 --- a/doc/cmd-v2-help/hscolour.txt +++ b/doc/cmd-v2-help/hscolour.txt @@ -20,3 +20,22 @@ Flags for hscolour: --css=PATH # Use a cascading style sheet Deprecated in favour of 'cabal haddock --hyperlink-source'. + +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`. diff --git a/doc/cmd-v2-help/info.txt b/doc/cmd-v2-help/info.txt index ba42007ac1a..790b633affd 100644 --- a/doc/cmd-v2-help/info.txt +++ b/doc/cmd-v2-help/info.txt @@ -16,3 +16,22 @@ Flags for info: list is ['global'], ['global', 'user'], depending on context. Use 'clear' to reset the list to empty. See the user guide for details. + +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`. diff --git a/doc/cmd-v2-help/init.txt b/doc/cmd-v2-help/init.txt index d1d1a35f140..ac08c30e583 100644 --- a/doc/cmd-v2-help/init.txt +++ b/doc/cmd-v2-help/init.txt @@ -85,3 +85,22 @@ Flags for init: inferred for the 'base' package. -v[n], --verbose[=n] # Control verbosity (n is 0--3, default verbosity level is 1) + +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`. diff --git a/doc/cmd-v2-help/install.txt b/doc/cmd-v2-help/install.txt index 8850a2a2890..7af69d27733 100644 --- a/doc/cmd-v2-help/install.txt +++ b/doc/cmd-v2-help/install.txt @@ -373,3 +373,22 @@ Examples: Install the package named pkgname (fetching it from hackage if necessary) cabal install ./pkgfoo Install the package in the ./pkgfoo directory + +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`. diff --git a/doc/cmd-v2-help/list-bin.txt b/doc/cmd-v2-help/list-bin.txt index 3b8b8f01156..cddcbdb99a6 100644 --- a/doc/cmd-v2-help/list-bin.txt +++ b/doc/cmd-v2-help/list-bin.txt @@ -363,3 +363,22 @@ Flags for list-bin: -z, --ignore-project # Ignore local project configuration (unless --project-dir or --project-file is also set) --project-file-parser=PARSER # Set the parser to use for the project file + +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`. diff --git a/doc/cmd-v2-help/list.txt b/doc/cmd-v2-help/list.txt index 215a0029560..d69a85594dc 100644 --- a/doc/cmd-v2-help/list.txt +++ b/doc/cmd-v2-help/list.txt @@ -29,3 +29,22 @@ Flags for list: Examples: cabal list pandoc Will find pandoc, pandoc-citeproc, pandoc-lens, ... + +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`. diff --git a/doc/cmd-v2-help/outdated.txt b/doc/cmd-v2-help/outdated.txt index 85a07dd7493..7b3ce102099 100644 --- a/doc/cmd-v2-help/outdated.txt +++ b/doc/cmd-v2-help/outdated.txt @@ -376,3 +376,22 @@ Flags for outdated: and '-v0' --ignore=PKGS # Packages to ignore --minor[=PKGS] # Ignore major version bumps for these packages + +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`. diff --git a/doc/cmd-v2-help/path.txt b/doc/cmd-v2-help/path.txt index 74f4a3b3355..4774f222c3e 100644 --- a/doc/cmd-v2-help/path.txt +++ b/doc/cmd-v2-help/path.txt @@ -386,3 +386,22 @@ Examples: Print the installation directory, taking project information into account. cabal path -z --output-format=key-value --installdir Print the installation directory, without taking project information into account. + +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`. diff --git a/doc/cmd-v2-help/repl.txt b/doc/cmd-v2-help/repl.txt index 2913c652167..cad84420f42 100644 --- a/doc/cmd-v2-help/repl.txt +++ b/doc/cmd-v2-help/repl.txt @@ -406,3 +406,22 @@ Examples, open an interactive session: add a version (constrained between 4.15 and 4.18) of the library 'lens' to the default component (or no component if there is no project present) cabal repl pkg:cabal-install-solver pkg:Cabal-syntax --enable-multi-repl for default (in this case library) components in two packages + +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`. diff --git a/doc/cmd-v2-help/report.txt b/doc/cmd-v2-help/report.txt index 34ddedce86d..0dcbfda25a3 100644 --- a/doc/cmd-v2-help/report.txt +++ b/doc/cmd-v2-help/report.txt @@ -17,3 +17,22 @@ Flags for report: You can store your Hackage login in the ~/.config/cabal/config file (the %APPDATA%\cabal\config file on Windows) + +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`. diff --git a/doc/cmd-v2-help/run.txt b/doc/cmd-v2-help/run.txt index f8dd2b32a58..31a28df9d67 100644 --- a/doc/cmd-v2-help/run.txt +++ b/doc/cmd-v2-help/run.txt @@ -387,3 +387,22 @@ Examples: Run the executable-like 'foo-tool' in the package 'pkgfoo' cabal run foo -O2 -- dothing --fooflag Build with '-O2' and run the program, passing it extra arguments. + +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`. diff --git a/doc/cmd-v2-help/sdist.txt b/doc/cmd-v2-help/sdist.txt index 8b40e1127a5..5074d37cda4 100644 --- a/doc/cmd-v2-help/sdist.txt +++ b/doc/cmd-v2-help/sdist.txt @@ -23,3 +23,22 @@ Flags for sdist: -o PATH or -oPATH, --output-directory=PATH # Choose the output directory of this command. '-' sends all output to stdout + +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`. diff --git a/doc/cmd-v2-help/target.txt b/doc/cmd-v2-help/target.txt index 6dddae62364..5f4a0237998 100644 --- a/doc/cmd-v2-help/target.txt +++ b/doc/cmd-v2-help/target.txt @@ -403,3 +403,22 @@ Examples: Targets of the package in the ./pkgfoo directory cabal target cname Targets of the component named cname in the project + +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`. diff --git a/doc/cmd-v2-help/test.txt b/doc/cmd-v2-help/test.txt index 00c529d1a3b..057d97bc462 100644 --- a/doc/cmd-v2-help/test.txt +++ b/doc/cmd-v2-help/test.txt @@ -383,3 +383,22 @@ Examples: Run the test-suite named cname cabal test cname --enable-coverage Run the test-suite built with code coverage (including local libs used) + +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`. diff --git a/doc/cmd-v2-help/unpack.txt b/doc/cmd-v2-help/unpack.txt index 415b4eb007d..a86b085ebb1 100644 --- a/doc/cmd-v2-help/unpack.txt +++ b/doc/cmd-v2-help/unpack.txt @@ -37,3 +37,22 @@ Examples: Download the latest stable version of hlint; cabal unpack lens --source-repository=head Download the source repository of lens (i.e. git clone from github). + +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`. diff --git a/doc/cmd-v2-help/update.txt b/doc/cmd-v2-help/update.txt index cc4e6a3ea26..58c95a861c7 100644 --- a/doc/cmd-v2-help/update.txt +++ b/doc/cmd-v2-help/update.txt @@ -381,3 +381,22 @@ Examples: Download hackage.haskell.org and head.hackage head.hackage must be a known repo-id. E.g. from your cabal.project(.local) file. + +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`. diff --git a/doc/cmd-v2-help/upload.txt b/doc/cmd-v2-help/upload.txt index 86bb0697eee..23ea12662b8 100644 --- a/doc/cmd-v2-help/upload.txt +++ b/doc/cmd-v2-help/upload.txt @@ -31,3 +31,22 @@ Relevant global configuration keys: username password password-command + +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`. diff --git a/doc/cmd-v2-help/user-config.txt b/doc/cmd-v2-help/user-config.txt index 1a54e235217..f257c68eafe 100644 --- a/doc/cmd-v2-help/user-config.txt +++ b/doc/cmd-v2-help/user-config.txt @@ -27,3 +27,22 @@ Flags for user-config: -a CONFIGLINE or -aCONFIGLINE, --augment=CONFIGLINE # Additional setting to augment the config file (replacing a previous setting if it existed). + +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`. diff --git a/doc/cmd-v2-hidden-help/act-as-setup.txt b/doc/cmd-v2-hidden-help/act-as-setup.txt index 8a369fe706e..1bd9345c930 100644 --- a/doc/cmd-v2-hidden-help/act-as-setup.txt +++ b/doc/cmd-v2-hidden-help/act-as-setup.txt @@ -5,3 +5,22 @@ Usage: cabal act-as-setup Flags for act-as-setup: -h, --help # Show this help text --build-type=BUILD-TYPE # Use the given build type. + +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`. diff --git a/doc/cmd-v2-hidden-help/format.txt b/doc/cmd-v2-hidden-help/format.txt index 79b6c036507..a896bff7468 100644 --- a/doc/cmd-v2-hidden-help/format.txt +++ b/doc/cmd-v2-hidden-help/format.txt @@ -4,3 +4,22 @@ Usage: cabal format [FILE] Flags for format: -h, --help # Show this help text + +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`. diff --git a/doc/cmd-v2-hidden-help/man.txt b/doc/cmd-v2-hidden-help/man.txt index 215c29f9962..1ae5e329ffc 100644 --- a/doc/cmd-v2-hidden-help/man.txt +++ b/doc/cmd-v2-hidden-help/man.txt @@ -9,3 +9,22 @@ Flags for man: -v[n], --verbose[=n] # Control verbosity (n is 0--3, default verbosity level is 1) --raw # Output raw troff content + +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`. From f1cc897c5f7eea4b8fa278fe841896d3143bb342 Mon Sep 17 00:00:00 2001 From: Ilya Baryshnikov Date: Sun, 30 Aug 2026 09:51:08 +0300 Subject: [PATCH 3/4] get options from headrs --- Cabal/src/Distribution/Simple/Command.hs | 8 +++++++- cabal-install/src/Distribution/Client/Main.hs | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Cabal/src/Distribution/Simple/Command.hs b/Cabal/src/Distribution/Simple/Command.hs index d3cff2db4e8..11daf566cf7 100644 --- a/Cabal/src/Distribution/Simple/Command.hs +++ b/Cabal/src/Distribution/Simple/Command.hs @@ -61,6 +61,7 @@ module Distribution.Simple.Command -- * Option Descriptions , OptDescr (..) , fmapOptDescr + , commandOptionsUsageInfo , Description , SFlags , LFlags @@ -467,6 +468,11 @@ commandHelp command pname = where cname = commandName command +-- | Render a table of options (given as 'OptionField's) for inclusion in a +-- help text, in the same format as the options section of 'commandHelp'. +commandOptionsUsageInfo :: String -> [OptionField flags] -> String +commandOptionsUsageInfo header = GetOpt.usageInfo header . concatMap viewAsGetOpt + -- | Default "usage" documentation text for commands. usageDefault :: String -> String -> String usageDefault name pname = @@ -708,7 +714,7 @@ commandsRunWithFallback globalCommand commands defaultCommand args = case lookupCommand name of [Command _ _ action _] -> case action ("--help" : cmdArgs') of - CommandHelp help -> pure $ CommandHelp help + CommandHelp help -> pure $ CommandReadyToGo (flags, CommandHelp help) CommandList _ -> pure $ CommandList [] _ -> pure $ CommandHelp globalHelp _ -> do diff --git a/cabal-install/src/Distribution/Client/Main.hs b/cabal-install/src/Distribution/Client/Main.hs index 8765a8f49d9..16111bbc265 100644 --- a/cabal-install/src/Distribution/Client/Main.hs +++ b/cabal-install/src/Distribution/Client/Main.hs @@ -197,8 +197,10 @@ import Distribution.Simple.Command , CommandSpec (..) , CommandType (..) , CommandUI (..) + , ShowOrParseArgs (..) , commandAddAction , commandFromSpec + , commandOptionsUsageInfo , commandShowOptions , commandsRunWithFallback , defaultCommandFallback @@ -324,6 +326,18 @@ main args = do mainWorker . (++ args1) =<< expandResponse args0 +-- | The section listing the global flags, appended to the help text of +-- every command, so that global options such as @--store-dir@ can be +-- discovered there (see issue #7587). +globalFlagsSection :: String +globalFlagsSection = + "\n" + ++ commandOptionsUsageInfo + "Global flags:" + (commandOptions (globalCommand []) ShowArgs) + ++ "\nGlobal flags must be given before the command, e.g.\n" + ++ "`cabal --store-dir=DIR build`.\n" + -- | Check whether assertions are enabled and print a warning in that case. warnIfAssertionsAreEnabled :: IO () warnIfAssertionsAreEnabled = @@ -405,6 +419,7 @@ mainWorker args = do printCommandHelp help = do pname <- getProgName putStr (help pname) + putStr globalFlagsSection printGlobalHelp help = do pname <- getProgName configFile <- defaultConfigFile From af9f3704d42c3e65845258af49780794ee1fba7d Mon Sep 17 00:00:00 2001 From: Ilya Baryshnikov Date: Sun, 30 Aug 2026 09:51:31 +0300 Subject: [PATCH 4/4] add changelog --- changelog.d/12299.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 changelog.d/12299.md diff --git a/changelog.d/12299.md b/changelog.d/12299.md new file mode 100644 index 00000000000..aa5d6528b02 --- /dev/null +++ b/changelog.d/12299.md @@ -0,0 +1,41 @@ +--- +synopsis: List global flags in the help text of every command +packages: [Cabal, cabal-install] +prs: 12299 +issues: 7587 +--- + +Example of the new `cabal build --help` output: + +```diff + 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`. +```