Skip to content

Add-persistent-flags - #14

Merged
jrschumacher merged 2 commits into
mainfrom
add-persistent-flags
Jun 26, 2025
Merged

jrschumacher merged 2 commits into
mainfrom
add-persistent-flags

Conversation

@jrschumacher

Copy link
Copy Markdown
Owner

No description provided.

  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
jrschumacher merged commit ec91438 into main Jun 26, 2025
@jrschumacher
jrschumacher deleted the add-persistent-flags branch June 26, 2025 06:41
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).
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.

1 participant

⌂ 换网址