Skip to content

Latest commit

 

History

History
113 lines (75 loc) · 3.55 KB

File metadata and controls

113 lines (75 loc) · 3.55 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

v0.7.0 - 2026-05-14

Added

  • flagtype.EnumDefault constructor for enums with an initial default value
  • Cmd field on State exposing the terminal command selected during parsing
  • Summary field on Command for the short text shown in command lists
  • UsageErrorf for opt-in usage errors; Run prints command help to stderr before returning the underlying error

Changed

  • BREAKING: Replace Command.UsageFunc with Command.Help, which returns the full help string for a command
  • BREAKING: Replace Command.ShortHelp with Command.Summary for command lists and Command.Description for longer command help text
  • BREAKING: Rename FlagOption to FlagConfig and Command.FlagOptions to Command.FlagConfigs
  • Commands with subcommands and no Exec now report a usage error when no child command is selected, before enforcing required flags inherited by child commands

Removed

  • BREAKING: Remove ErrHelp; check errors.Is(err, flag.ErrHelp) when handling Parse directly
  • BREAKING: Remove DefaultUsage and the top-level Usage function from the public API

v0.6.0 - 2026-02-18

Added

  • New flagtype package with common flag.Value implementations: StringSlice, Enum, StringMap, URL, and Regexp

v0.5.0 - 2026-02-17

Changed

  • BREAKING: Rename FlagMetadata to FlagOption and FlagsMetadata field to FlagOptions

v0.4.0 - 2026-02-16

Added

  • Local field on FlagOption for granular control over flag inheritance -- flags marked local are not inherited by subcommands
  • Short flag aliases via FlagOption.Short
  • ParseAndRun convenience function for parsing and running a command in one call

Changed

  • Enhanced usage output with type hints, required markers, and zero-default suppression
  • Improved ParseToEnd and internal flag parsing with edge case fixes

Fixed

  • Default nil context to context.Background in Run

v0.3.0 - 2025-11-22

Added

  • Top-level graceful package for signal handling
  • Comprehensive edge case tests for CLI library

Changed

  • Use sync.Once to get module name from runtime
  • Improve panic location reporting

v0.2.1 - 2025-02-01

Changed

  • Update name regex to allow underscore and dash in command names

v0.2.0 - 2025-01-07

Removed

  • Remove ParseAndRun in favor of separate parse and run steps

v0.1.0 - 2025-01-06

Added

  • Initial release of the CLI library
  • Command tree with subcommands and flag parsing
  • Path method on *Command for full command path
  • Flag metadata with required flag support
  • Command name typo suggestions (Levenshtein distance)
  • Boolean flag handling
  • textutil and suggest helper packages
  • GitHub Actions CI