Skip to content

Releases: spf13/cobra

v1.10.2

04 Dec 00:07
88b30ab

Choose a tag to compare

πŸ”§ Dependencies

  • chore: Migrate from gopkg.in/yaml.v3 to go.yaml.in/yaml/v3 by @dims in #2336 - the gopkg.in/yaml.v3 package has been deprecated for some time: this should significantly cleanup dependency/supply-chains for consumers of spf13/cobra

πŸ“ˆ CI/CD

πŸ”₯✍🏼 Docs

  • Add documentation for repeated flags functionality by @rvergis in #2316

πŸ‚ Refactors

  • refactor: replace several vars with consts by @htoyoda18 in #2328
  • refactor: change minUsagePadding from var to const by @ssam18 in #2325

πŸ€— New Contributors

Full Changelog: v1.10.1...v1.10.2

Thank you to our amazing contributors!!!!! 🐍 πŸš€

v1.10.1

01 Sep 16:32
7da941c

Choose a tag to compare

πŸ› Fix

v1.0.9 of pflags brought back ParseErrorsWhitelist and marked it as deprecated

Full Changelog: v1.10.0...v1.10.1

v1.10.0

01 Sep 13:39
51d6751

Choose a tag to compare

What's Changed

🚨 Attention!

This version of pflag carried a breaking change: it renamed ParseErrorsWhitelist to ParseErrorsAllowlist which can break builds if both pflag and cobra are dependencies in your project.

  • If you use both pflag and cobra, upgrade pflagto 1.0.8 andcobrato1.10.0`
  • or use the newer, fixed version of pflag v1.0.9 which keeps the deprecated ParseErrorsWhitelist

More details can be found here: #2303 (comment)

✨ Features

  • Flow context to command in SetHelpFunc by @Frassle in #2241
  • The default ShellCompDirective can be customized for a command and its subcommands by @albers in #2238

πŸ› Fix

  • Upgrade golangci-lint to v2, address findings by @scop in #2279

πŸͺ  Testing

πŸ“ Docs

New Contributors

Full Changelog: v1.9.1...v1.9.2

v1.9.1

16 Feb 23:54
40b5bc1

Choose a tag to compare

πŸ› Fixes

Full Changelog: v1.9.0...v1.9.1

v1.9.0

15 Feb 18:28
5f9c408

Choose a tag to compare

✨ Features

  • Allow linker to perform deadcode elimination for program using Cobra by @aarzilli in #1956
  • Add default completion command even if there are no other sub-commands by @marckhouzam in #1559
  • Add CompletionWithDesc helper by @ccoVeille in #2231

πŸ› Fixes

πŸ€– Completions

  • Make Powershell completion work in constrained mode by @lstemplinger in #2196
  • Improve detection for flags that accept multiple values by @thaJeztah in #2210
  • add CompletionFunc type to help with completions by @ccoVeille in #2220
  • Add similar whitespace escape logic to bash v2 completions than in other completions by @kangasta in #1743
  • Print ActiveHelp for bash along other completions by @marckhouzam in #2076
  • fix(completions): Complete map flags multiple times by @gabe565 in #2174
  • fix(bash): nounset unbound file filter variable on empty extension by @scop in #2228

πŸ§ͺ Testing

✍🏼 Documentation

πŸ”§ Dependency upgrades


Thank you to all of our amazing contributors and all the great work that's been going into the completions feature!!

πŸ‘‹πŸΌ New Contributors

Full Changelog: v1.8.1...v1.9.0

v1.8.1

14 Jun 20:55
e94f6d0

Choose a tag to compare

✨ Features

  • Add env variable to suppress completion descriptions on create by @scop in #1938

πŸ› Bug fixes

πŸ”§ Maintenance

  • build(deps): bump github.com/cpuguy83/go-md2man/v2 from 2.0.3 to 2.0.4 by @dependabot in #2127
  • Consistent annotation names by @nirs in #2140
  • Remove fully inactivated linters by @nirs in #2148
  • Address golangci-lint deprecation warnings, enable some more linters by @scop in #2152

πŸ§ͺ Testing & CI/CD

✏️ Documentation

New Contributors


Thank you everyone who contributed to this release and all your hard work! Cobra and this community would never be possible without all of you!!!! 🐍

Full Changelog: v1.8.0...v1.8.1

v1.8.0

04 Nov 21:06
a0a6ae0

Choose a tag to compare

✨ Features

  • Support usage as plugin for tools like kubectl by @nirs in #2018 - this means that programs that utilize a "plugin-like" structure have much better support and usage (like for completions, command paths, etc.)
  • Move documentation sources to site/content by @umarcor in #1428
  • Add 'one required flag' group by @marevers in #1952 - this includes a new MarkFlagsOneRequired API for flags which can be used to mark a flag group as required and cause command failure if at least one is not used when invoked.
  • Customizable error message prefix by @5ouma in #2023 - This adds the SetErrPrefix and ErrPrefix APIs on the Command struct to allow for setting a custom prefix for errors
  • feat: add getters for flag completions by @avirtopeanu-ionos in #1943
  • Feature: allow running persistent run hooks of all parents by @vkhoroz in #2044
  • Improve API to get flag completion function by @marckhouzam in #2063

πŸ› Bug fixes

πŸ”§ Maintenance

πŸ§ͺ Testing & CI/CD

✏️ Documentation

  • doc: fix typo, Deperecated -> Deprecated by @callthingsoff in #2000
  • Add notes to doc about the execution condition of *PreRun and *PostRun functions by @haoming29 in #2041

Thank you everyone who contributed to this release and all your hard work! Cobra and this community would never be possible without all of you!!!! 🐍

Full Changelog: v1.7.0...v1.8.0

v1.7.0

04 Apr 14:43
4dd4b25

Choose a tag to compare

✨ Features

πŸ› Bug fixes

πŸ§ͺ Testing & CI/CD

πŸ”§ Maintenance

✏️ Documentation


This release contains several long running fixes, improvements to powershell completions, and further optimizations for completions.

Thank you everyone who contributed to this release and all your hard work! Cobra and this community would never be possible without all of you! 🐍

Full changelog: v1.6.1...v1.7.0

v1.6.1

24 Oct 23:03
b43be99

Choose a tag to compare

Bug fixes πŸ›

  • Fixes a panic when AddGroup isn't called before AddCommand(my-sub-command) is executed. This can happen within more complex cobra file structures that have many different inits to be executed. Now, the check for groups has been moved to ExecuteC and provides more flexibility when working with grouped commands - @marckhouzam (and shout out to @aawsome, @andig and @KINGSABRI for a deep investigation into this! πŸ‘πŸΌ)

v1.6.0

11 Oct 15:37
8607918

Choose a tag to compare

Summer 2022 Release

Some exciting changes make their way to Cobra! Command completions continue to get better and better (including adding --help and --version automatic flags to the completions list). Grouping is now possible in your help output as well! And you can now use the OnFinalize method to cleanup things when all "work" is done. Checkout the full changelog below:


Features 🌠

Deprecation πŸ‘ŽπŸΌ

  • ExactValidArgs is deprecated (but not being removed entirely). This is abit nuanced, so checkout #1643 for further information and the updated user_guide.md on how this may affect you (and how you can take advantage of the correct behavior in the validators): @umarcor #1643

Bug fixes πŸ›

  • Fix (bash-v2) activeHelp length check syntax: @scop #1762
  • Fix correct command path in see_also for yaml documentation: @zregvart #1771
  • Fix showing flags that shadow parent persistent flag in child help messaging: @brianpursley #1776

Dependencies πŸ—³οΈ

Testing πŸ€”

Docs ✏️

Misc πŸ’­

Note: Per #1804, we will be moving away from "seasonal" releases and doing more generic point release targets. Continue to track the milestones and issues in the spf13/cobra GitHub repository for more information!

Great work everyone! Cobra would never be possible without your contributions! 🐍

Full Changelog: v1.5.0...v1.6.0