Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

No <cmd> advice on cfn-lint --help #110

Closed
martysweet opened this issue Feb 15, 2018 · 4 comments
Closed

No <cmd> advice on cfn-lint --help #110

martysweet opened this issue Feb 15, 2018 · 4 comments

Comments

@martysweet
Copy link
Owner

martysweet commented Feb 15, 2018

The help section should show some examples of how to use the command. Including what options for there are.

user@a55ae7f0fda6:/# cfn-lint --help

  Usage: index [options] <cmd> <file>


  Options:

    -V, --version                        output the version number
    -p, --parameters <items>             List of params
    -p, --pseudo <items>                 List of pseudo overrides
    -G, --no-guess-parameters            Fail validation if a parameter with no Default is not passed
    -g, --only-guess-parameters <items>  Guess the provided parameters, and fail validation if a parameter with no Default is passed
    -h, --help                           output usage information
@RazzM13
Copy link
Contributor

RazzM13 commented Apr 10, 2018

In PR #136, I've updated the --help output to the following:

$ cfn-lint --help

  Usage: cfn-lint [options] [command]

  Options:

    -V, --version       output the version number
    -h, --help          output usage information

  Commands:

    validate [options]
    docs

no command given!

Also, I've taken the liberty of showing the usage prompt in cases where either the command or the argument is missing.

@RazzM13
Copy link
Contributor

RazzM13 commented Apr 10, 2018

PS: perhaps the no command given! and missing required argument messages should have the first letter uppercased and perhaps an exclamation mark could be added to the latter.

@martysweet
Copy link
Owner Author

@RazzM13, does this allow people to run cfn-lint validate --help to see the related options?

@RazzM13
Copy link
Contributor

RazzM13 commented Apr 21, 2018

Hi @martysweet, yes it does for validate as well as for docs.

$ cfn-lint validate --help

  Usage: validate [options]

  Options:

    -p, --parameters <items>             List of params
    -p, --pseudo <items>                 List of pseudo overrides
    --guess-parameters                   Guess any parameters that are not explicitely passed in and have no Default. This is the default behaviour.
    -G, --no-guess-parameters            Fail validation if a parameter with no Default is not passed
    -g, --only-guess-parameters <items>  Guess the provided parameters, and fail validation if a parameter with no Default is passed
    -v, --verbose                        Verbose error messages
    -h, --help                           output usage information

 missing required argument
$ cfn-lint docs --help

  Usage: docs [options]

  Options:

    -h, --help  output usage information

 missing required argument

And even when no arguments have been provided:

$ cfn-lint validate

  Usage: validate [options]

  Options:

    -p, --parameters <items>             List of params
    -p, --pseudo <items>                 List of pseudo overrides
    --guess-parameters                   Guess any parameters that are not explicitely passed in and have no Default. This is the default behaviour.
    -G, --no-guess-parameters            Fail validation if a parameter with no Default is not passed
    -g, --only-guess-parameters <items>  Guess the provided parameters, and fail validation if a parameter with no Default is passed
    -v, --verbose                        Verbose error messages
    -h, --help                           output usage information

 missing required argument

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants