Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6581 Add stack -h #6582

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ jobs:
include:
- os: ubuntu-latest
release-args: "--alpine"
cache-bust: "2024-01-20"
cache-bust: "2024-05-17"
- os: windows-latest
release-args: ""
cache-bust: "2024-01-20"
cache-bust: "2024-05-17"
- os: macos-13
release-args: ""
cache-bust: "2024-01-20"
cache-bust: "2024-05-17"
# macos-latest provides macOS/AArch64 (M1)
- os: macos-latest
release-args: ""
cache-bust: "2024-02-02"
cache-bust: "2024-05-17"
steps:
- name: Clone project
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Other enhancements:
Stack is available in YAML configuration files.
* Add the `ls globals` command to list all global packages for the version of
GHC specified by the snapshot.
* Add `stack -h` (equivalent to `stack --help`).

Bug fixes:

Expand Down
6 changes: 3 additions & 3 deletions doc/GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ package sets called __snapshots__.

Stack has also been designed from the ground up to be user friendly, with an
intuitive, discoverable command line interface. For many users, simply
downloading Stack and reading `stack --help` will be enough to get up and
running. This guide provides a more gradual tour for users who prefer that
downloading Stack and reading `stack --help` (or `-h`) will be enough to get up
and running. This guide provides a more gradual tour for users who prefer that
learning style.

To build your project, Stack uses a project-level configuration file, named
Expand Down Expand Up @@ -830,7 +830,7 @@ understand why rebuilding may occur at different points.

## The build synonyms

Let's look at a subset of the `stack --help` output:
Let's look at a subset of the `stack --help` (or `-h`) output:

~~~text
build Build the package(s) in this directory/configuration
Expand Down
6 changes: 3 additions & 3 deletions doc/global_flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Default: `https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots
The `--snapshot-location-base <url>` command option specifies the base location
of snapshots.

## `--help` command flag
## `--help` or `-h` command flags

If Stack is passed the `--help` command flag, it will output help for the
command.
If Stack is passed the `--help` (or `-h`) command flag, it will output help for
the command.
8 changes: 4 additions & 4 deletions doc/other_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

There are lots of resources available for learning more about Stack:

* `stack` or `stack --help` — lists Stack's commands, and flags and options
common to those commands
* `stack <command> --help` — provides help on the particular Stack command,
including flags and options specific to the command
* `stack`, `stack --help` (or `-h`) — lists Stack's commands, and flags and
options common to those commands
* `stack <command> --help` (or `-h`) — provides help on the particular Stack
command, including flags and options specific to the command
* `stack --version` — identify the version and Git hash of the Stack executable
* `--verbose` (or `-v`) — much more info about internal operations (useful for
bug reports)
Expand Down
7 changes: 4 additions & 3 deletions src/Options/Applicative/Complicated.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import Control.Monad.Trans.Writer ( runWriter, tell )
import Options.Applicative
( Parser, ParserFailure, ParserHelp, ParserResult (..)
, abortOption, command, execParserPure, footer, fullDesc
, handleParseResult, header, help, info, infoOption, long
, metavar, noBacktrack, prefs, progDesc, showHelpOnEmpty
, hsubparser
, handleParseResult, header, help, hsubparser, info
, infoOption, long, metavar, noBacktrack, prefs, progDesc
, short, showHelpOnEmpty
)
import Options.Applicative.Builder.Extra ( showHelpText )
import Stack.Prelude
Expand Down Expand Up @@ -186,4 +186,5 @@ helpOption :: Parser (a -> a)
helpOption =
abortOption showHelpText $
long "help"
<> short 'h'
<> help "Show this help text."
3 changes: 2 additions & 1 deletion src/Stack/Constants.hs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,8 @@ isStackUploadDisabled = STACK_DISABLE_STACK_UPLOAD
-- | The footer to the help for Stack's subcommands
globalFooter :: String
globalFooter =
"Command 'stack --help' for global options that apply to all subcommands."
"Command 'stack --help' (or '-h') for global options that apply to all "
<> "subcommands."

-- | The type for GitHub REST API HTTP \'Basic\' authentication.
gitHubBasicAuthType :: ByteString
Expand Down