Repository navigation
Add-persistent-flags - #14
Merged
Merged
Conversation
Add support for persistent_flags in YAML frontmatter that generate
Cobra persistent flags available to all subcommands.
Changes:
- Add PersistentFlags []Flag field to Command type
- Update parser to handle persistent_flags section in YAML
- Modify templates to generate cmd.PersistentFlags() calls
- Add PersistentFlags field to request structs with proper extraction
- Include persistent flag validation and enum support
- Update adder root command with --verbose/--quiet persistent flags
- Fix main.go to use generated root command for proper flag inheritance
- Update golden files for new template format
- Remove otdfctl references from documentation
Example usage:
```yaml
command:
name: mycli
persistent_flags:
- name: verbose
shorthand: v
description: Enable verbose output
type: bool
```
Generates flags available globally: mycli --verbose subcommand
jrschumacher
added a commit
that referenced
this pull request
Jun 26, 2025
🤖 I have created a release *beep* *boop* --- ## [0.5.0](v0.4.0...v0.5.0) (2025-06-26) ### Features * add persistent_flags support for global CLI flags ([#14](#14)) ([ec91438](ec91438)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
jrschumacher
added a commit
that referenced
this pull request
Jun 26, 2025
🤖 I have created a release *beep* *boop* --- ## [0.5.0](v0.4.0...v0.5.0) (2025-06-26) ### Features * add persistent_flags support for global CLI flags ([#14](#14)) ([ec91438](ec91438)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.