commercialhaskell / commercialhaskell/stack

Bubble command options up the command tree?

Open
#6,060 1 comment 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Is it possible to include some mention of options relevant to a command with the help for that command even if it might not apply to all subcommands? For `stack config` the `--global` option is not shown until deep within the command tree and this option is not shown for `stack --help`.

The `--global` option is not shown at the `config` level.
```
$ stack config --help
Usage: stack config [--setup-info-yaml URL] [--snapshot-location-base URL]
COMMAND [--setup-info-yaml URL]
[--snapshot-location-base URL] [--help]

Subcommands for accessing and modifying configuration values

Available options:
--setup-info-yaml URL Alternate URL or relative / absolute path for Stack
dependencies
--snapshot-location-base URL
The base location of LTS/Nightly snapshots
--setup-info-yaml URL Alternate URL or relative / absolute path for Stack
dependencies
--snapshot-location-base URL
The base location of LTS/Nightly snapshots
--help Show this help text

Available commands:
set Sets a key in YAML configuration file to value
env Print environment variables for use in a shell

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

Nor is it shown at the `config set` level.
```
$ stack config set --help
Usage: stack config set COMMAND [--setup-info-yaml URL]
[--snapshot-location-base URL] [--help]

Sets a key in YAML configuration file to value

Available options:
--setup-info-yaml URL Alternate URL or relative / absolute path for Stack
dependencies
--snapshot-location-base URL
The base location of LTS/Nightly snapshots
--help Show this help text

Available commands:
resolver Change the resolver of the current project.
system-ghc Configure whether Stack should use a system GHC
installation or not.
install-ghc Configure whether Stack should automatically install
GHC when necessary.
package-index Configure Stack's package index

Command 'stack --help' for global options that apply to all subcommands.
```
It is show at the `config set install-ghc` level.
```
$ stack config set install-ghc --help
Usage: stack config set install-ghc [--global] true|false

Configure whether Stack should automatically install GHC when necessary.

Available options:
--global Modify the user-specific global configuration file
('config.yaml') instead of the project-level
configuration file ('stack.yaml').
-h,--help Show this help text
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.