Skip to content

Help for positional args without allcmd.ArgsRequired dependent from arg.Required#342

Merged
jessevdk merged 1 commit intojessevdk:masterfrom
sv99:help-pos-required
Jun 7, 2021
Merged

Help for positional args without allcmd.ArgsRequired dependent from arg.Required#342
jessevdk merged 1 commit intojessevdk:masterfrom
sv99:help-pos-required

Conversation

@sv99
Copy link
Copy Markdown
Contributor

@sv99 sv99 commented Jul 15, 2020

In my project have 2 positional argument - one required and other optional.
Now help print both optional or required dependent from allcmd.ArgsRequired

type Options struct {
	Verbose		bool	`short:"v" long:"verbose" description:"Show verbose debug information"`
	Extensions	string 	`short:"e" long:"ext" description:"Executable extensions" default:"bat|exe"`
	Positional struct {
		Filepath string `positional-arg-name:"filepath" required:"yes"`
		Filename string `positional-arg-name:"filename"`
	} `positional-args:"yes"`
}

now help print

Usage:
  deepfindexe [OPTIONS] [filepath] [filename]

with this patch print

Usage:
  deepfindexe [OPTIONS] filepath [filename]

Copy link
Copy Markdown
Owner

@jessevdk jessevdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jessevdk jessevdk merged commit 3927b71 into jessevdk:master Jun 7, 2021
nabeken referenced this pull request in nabeken/psadm Jun 17, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/jessevdk/go-flags](https://togithub.com/jessevdk/go-flags)
| require | minor | `v1.5.0` -> `v1.6.1` |

---

### Release Notes

<details>
<summary>jessevdk/go-flags (github.com/jessevdk/go-flags)</summary>

###
[`v1.6.1`](https://togithub.com/jessevdk/go-flags/releases/tag/v1.6.1)

[Compare
Source](https://togithub.com/jessevdk/go-flags/compare/v1.6.0...v1.6.1)

**Full Changelog**:
jessevdk/go-flags@v1.6.0...v1.6.1

###
[`v1.6.0`](https://togithub.com/jessevdk/go-flags/releases/tag/v1.6.0)

[Compare
Source](https://togithub.com/jessevdk/go-flags/compare/v1.5.0...v1.6.0)

#### What's Changed

- ini: fix IniParser.write() for zero values by
[@&#8203;sean-](https://togithub.com/sean-) in
[https://github.com/jessevdk/go-flags/pull/332](https://togithub.com/jessevdk/go-flags/pull/332)
- fix a panic when generating help while the subcommand and all option
groups are hidden by [@&#8203;bboozzoo](https://togithub.com/bboozzoo)
in
[https://github.com/jessevdk/go-flags/pull/354](https://togithub.com/jessevdk/go-flags/pull/354)
- Help for positional args without allcmd.ArgsRequired dependent from
arg.Required by [@&#8203;sv99](https://togithub.com/sv99) in
[https://github.com/jessevdk/go-flags/pull/342](https://togithub.com/jessevdk/go-flags/pull/342)
- Bump golang.org/x/sys from 0.0.0-20210320140829-1e4c9ba3b0c4 to 0.1.0
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/jessevdk/go-flags/pull/396](https://togithub.com/jessevdk/go-flags/pull/396)
- Option to allow passing value to bool flag by
[@&#8203;alexcb](https://togithub.com/alexcb) in
[https://github.com/jessevdk/go-flags/pull/367](https://togithub.com/jessevdk/go-flags/pull/367)
- Add support for SOURCE_DATE_EPOCH for TestMan by
[@&#8203;anthonyfok](https://togithub.com/anthonyfok) in
[https://github.com/jessevdk/go-flags/pull/376](https://togithub.com/jessevdk/go-flags/pull/376)
- Update to run go-flags on AIX by
[@&#8203;llrocha](https://togithub.com/llrocha) in
[https://github.com/jessevdk/go-flags/pull/390](https://togithub.com/jessevdk/go-flags/pull/390)
- Add option for key value delimiter by
[@&#8203;anaprimawaty](https://togithub.com/anaprimawaty) in
[https://github.com/jessevdk/go-flags/pull/392](https://togithub.com/jessevdk/go-flags/pull/392)
- Undersocre support for numbers (set default base for strconv.Parse\*
to 0) by [@&#8203;GRbit](https://togithub.com/GRbit) in
[https://github.com/jessevdk/go-flags/pull/404](https://togithub.com/jessevdk/go-flags/pull/404)
- docs: add ENV variable usage example by
[@&#8203;cemremengu](https://togithub.com/cemremengu) in
[https://github.com/jessevdk/go-flags/pull/371](https://togithub.com/jessevdk/go-flags/pull/371)
- Support per-command PassAfterNonOption by
[@&#8203;woky](https://togithub.com/woky) in
[https://github.com/jessevdk/go-flags/pull/393](https://togithub.com/jessevdk/go-flags/pull/393)
- Upgrade by [@&#8203;jessevdk](https://togithub.com/jessevdk) in
[https://github.com/jessevdk/go-flags/pull/406](https://togithub.com/jessevdk/go-flags/pull/406)

#### New Contributors

- [@&#8203;sean-](https://togithub.com/sean-) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/332](https://togithub.com/jessevdk/go-flags/pull/332)
- [@&#8203;sv99](https://togithub.com/sv99) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/342](https://togithub.com/jessevdk/go-flags/pull/342)
- [@&#8203;dependabot](https://togithub.com/dependabot) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/396](https://togithub.com/jessevdk/go-flags/pull/396)
- [@&#8203;alexcb](https://togithub.com/alexcb) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/367](https://togithub.com/jessevdk/go-flags/pull/367)
- [@&#8203;anthonyfok](https://togithub.com/anthonyfok) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/376](https://togithub.com/jessevdk/go-flags/pull/376)
- [@&#8203;llrocha](https://togithub.com/llrocha) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/390](https://togithub.com/jessevdk/go-flags/pull/390)
- [@&#8203;anaprimawaty](https://togithub.com/anaprimawaty) made their
first contribution in
[https://github.com/jessevdk/go-flags/pull/392](https://togithub.com/jessevdk/go-flags/pull/392)
- [@&#8203;GRbit](https://togithub.com/GRbit) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/404](https://togithub.com/jessevdk/go-flags/pull/404)
- [@&#8203;cemremengu](https://togithub.com/cemremengu) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/371](https://togithub.com/jessevdk/go-flags/pull/371)
- [@&#8203;woky](https://togithub.com/woky) made their first
contribution in
[https://github.com/jessevdk/go-flags/pull/393](https://togithub.com/jessevdk/go-flags/pull/393)

**Full Changelog**:
jessevdk/go-flags@v1.5.0...v1.6.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MDIuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQwMi4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants