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

Subcommands should show help with no args #809

Closed
chrisdone opened this issue Aug 17, 2015 · 2 comments
Closed

Subcommands should show help with no args #809

chrisdone opened this issue Aug 17, 2015 · 2 comments

Comments

@chrisdone
Copy link
Member

This subcommand currently isn't too helpful:

chris@retina:~/Work/stack$ stack ide
Usage: stack ide [--help] COMMAND
  IDE-specific commands

Running stack by itself produces stack --help, but seems that subcommands still have this issue.

@chrisdone chrisdone added this to the Options parsing milestone Aug 17, 2015
@borsboom borsboom modified the milestones: Options parsing, P2 Sep 12, 2015
@HuwCampbell
Copy link

Can now use showHelpOnEmpty.

@mpilgrem
Copy link
Member

I will propose a pull request that I think fixes this.

mpilgrem added a commit to mpilgrem/stack that referenced this issue Jul 20, 2022
For example, before the change, `stack ls` yields only:

~~~
Missing: COMMAND

Usage: stack.exe ls COMMAND [--setup-info-yaml URL]
                    [--snapshot-location-base URL] [--help]
  List command. (Supports snapshots, dependencies and stack's styles)
~~~

After the change, `stack ls` yields the more informative:

~~~
Usage: stack.exe ls COMMAND [--setup-info-yaml URL]
                    [--snapshot-location-base URL] [--help]
  List command. (Supports snapshots, dependencies and stack's styles)

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:
  snapshots                View local snapshot (default option)
  dependencies             View the dependencies
  stack-colors             View stack's output styles
  stack-colours            View stack's output styles (alias for 'stack-colors')

Run 'stack --help' for global options that apply to all subcommands.
~~~

Also deletes the case:

~~~haskell
Failure _ | null args -> withArgs ["--help"] (execParser parser)
~~~

as `stack` (without more) is now handled without it.

Tested by building and using Stack, including using Stack with scripts and `stack script`.
mpilgrem added a commit that referenced this issue Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants