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

-h and --help do not honour the -- operator #41

Closed
jawher opened this issue Jan 18, 2017 · 1 comment
Closed

-h and --help do not honour the -- operator #41

jawher opened this issue Jan 18, 2017 · 1 comment
Labels

Comments

@jawher
Copy link
Owner

jawher commented Jan 18, 2017

Given an app or a command with the following spec CMD -- ARG..., calling the command with go -h for example would still print the command help instead of parsing -h as ARG.

@jawher jawher added the bug label Jan 18, 2017
@jlrigau
Copy link

jlrigau commented Jan 19, 2017

Same behaviour with -v and --version

jawher added a commit that referenced this issue Jan 22, 2017
" mow.cli" used to search for -h, --help, -v, --version, ... shortcuts
in all the arguments.
This causes an issue with `--` (all what follows is an arg), e.g.:

```
app -- -h
```

Would still display the app help instead of treating `-h` as the
argument it is.

Fixes #41
jawher added a commit that referenced this issue Jan 22, 2017
" mow.cli" used to search for -h, --help, -v, --version, ... shortcuts
in all the arguments.
This causes an issue with `--` (all what follows is an arg), e.g.:

```
app -- -h
```

Would still display the app help instead of treating `-h` as the
argument it is.

Fixes #41
jawher added a commit that referenced this issue Jul 27, 2017
" mow.cli" used to search for -h, --help, -v, --version, ... shortcuts
in all the arguments.
This causes an issue with `--` (all what follows is an arg), e.g.:

```
app -- -h
```

Would still display the app help instead of treating `-h` as the
argument it is.

Fixes #41
jawher added a commit that referenced this issue Aug 14, 2017
" mow.cli" used to search for -h, --help, -v, --version, ... shortcuts
in all the arguments.
This causes an issue with `--` (all what follows is an arg), e.g.:

```
app -- -h
```

Would still display the app help instead of treating `-h` as the
argument it is.

Fixes #41
jawher added a commit that referenced this issue Aug 15, 2017
" mow.cli" used to search for -h, --help, -v, --version, ... shortcuts
in all the arguments.
This causes an issue with `--` (all what follows is an arg), e.g.:

```
app -- -h
```

Would still display the app help instead of treating `-h` as the
argument it is.

Also, this PR changes how the library handles encountering help and
version flags.
Instead of calling os.exit, the value of `errorHandling` is now used to
decide.
If it is `ContinueOnError`, than exit is not called and an nil error is
returned from `app.Run`.
The old behaviour is still available with `ExitOnError`.

Fixes #41
jawher added a commit that referenced this issue Aug 16, 2017
" mow.cli" used to search for -h, --help, -v, --version, ... shortcuts
in all the arguments.
This causes an issue with `--` (all what follows is an arg), e.g.:

```
app -- -h
```

Would still display the app help instead of treating `-h` as the
argument it is.

Also, this PR changes how the library handles encountering help and
version flags.
Instead of calling os.exit, the value of `errorHandling` is now used to
decide.
If it is `ContinueOnError`, than exit is not called and an nil error is
returned from `app.Run`.
The old behaviour is still available with `ExitOnError`.

Fixes #41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants