Skip to content

Release v0.1.0

Choose a tag to compare

@github-actions github-actions released this 26 Apr 20:39
· 91 commits to master since this release
Immutable release. Only release title and notes can be modified.
v0.1.0
668a8d6

Added

  • Shell completion script generation via Parser.WriteCompletion(...), Parser.WriteNamedCompletion(...), and Parser.WriteAutoCompletion(...) for bash, zsh, and pwsh. Completion output includes command/option aliases, option choices, completion tag hints (file, dir, none) for options/positionals, bool value candidates when AllowBoolValues is enabled, and no-space handling for inline option values. Shell auto-detection (zsh / pwsh) falls back to bash when unknown.
  • Template-based parser documentation rendering via Parser.WriteDoc(...), DocFormat, DocOption, built-in markdown/html/man templates, custom template sources/data, hidden-entity controls, and template registry helpers ListBuiltinTemplates(...) / WriteBuiltinTemplate(...).
  • Opt-in i18n for built-in help, errors, version output, generated docs, INI examples, completion descriptions, and user-facing metadata through *-i18n tags, JSON catalog loaders, built-in locale catalogs, locale fallback, Localizer, and catalog coverage validation helpers.
  • Built-in version output via VersionFlag, VersionInfo, ReadVersionInfo(...), Parser.WriteVersion(...), version override setters, and VersionFields field masks.
  • Configurable help/error presentation: ColorHelp, ColorErrors, help/error color schemes, ShowCommandAliases, ShowRepeatableInHelp, HideEnvInHelp, KeepDescriptionWhitespace, shell-aware render styles, help width control, command option indentation control, and terminal-title updates.
  • Parser error/output routing controls: PrintHelpOnStderr, PrintErrorsOnStdout and PrintHelpOnInputErrors.
  • Display grouping for commands in CLI help and generated documentation via command-group, Command.SetCommandGroup(...), and .Doc.CommandGroups.
  • Opt-in built-in help, version, completion, docs, and config commands via HelpCommand, VersionCommand, CompletionCommand, DocsCommand, ConfigCommand, and the HelpCommands convenience mask.
  • Extended struct-tag support: parser tag remapping, plural list tags (defaults, choices, aliases), configurable list delimiters, option aliases, terminator, order, auto-env, immediate, command aliases, command-local parsing controls, i18n tags, stable INI names, and positional argument defaults.
  • Runtime configuration APIs for parser, command, group, option and positional metadata, including Configurer, Parser.Validate(), Parser.Rebuild(), built-in option accessors, and setter methods for aliases, visibility, defaults, choices, env/INI metadata, parsing behavior, and display metadata.
  • Configuration-first parsing helpers: DefaultsIfEmpty, RequiredFromValues, and ConfiguredValues.
  • Environment provisioning helpers: Parser.SetEnvPrefix(...), EnvProvisioning, and per-option auto-env opt-in/opt-out behavior.
  • Environment detection API for runtime hints: DetectEnvironment(), DetectTTY(), DetectFileTTY(...), DetectWriterTTY(...), and DetectColorSupport(...).
  • Dynamic defaults via DefaultProvider, plus support for encoding.TextMarshaler / encoding.TextUnmarshaler with existing flags.Marshaler / flags.Unmarshaler precedence.
  • Configurable option ordering through Parser.SetOptionSort(...), Parser.SetOptionTypeOrder(...), and the order tag.
  • INI example rendering via IniParser.WriteExample(...) and IniParser.WriteExampleWithOptions(...).
  • Advanced examples, i18n examples, custom tag examples, rendered documentation snapshots, zsh completion template, and benchmark coverage for core parse/help/INI/doc flows.

Changed

  • Module path moved to github.com/woozymasta/flags.
  • Dependency switched from github.com/sergi/go-diff to github.com/google/go-cmp.
  • ⚠️ breaking: minimum supported Go version increased from 1.20 to 1.25.
  • Dependencies were modernized, including golang.org/x/sys, golang.org/x/text, and golang.org/x/term.
  • Built-in help rendering was overhauled: wrapping/alignment use display width, terminal width is detected through x/term with stdio fallback, choice lists and value placeholders adapt to available width, command option descriptions share the global description column, and width can be disabled with Parser.SetHelpWidth(0).
  • Built-in documentation/man rendering now goes through the shared template renderer; the legacy standalone man writer was replaced by man/default.
  • Parser validation now reports duplicate short/long/env names and alias collisions, including built-in help/version option conflicts; metadata setter methods validate updates before applying them.
  • Boolean struct-tag parsing is unified across option/group/command tags and rejects invalid boolean values consistently.
  • Built-in help/version options are materialized lazily and can be customized before parsing.
  • Package documentation, README content, examples, and struct-tag reference were rewritten around the forked module path and current feature set.
  • CI/checking workflow was replaced with lint, formatting, security, cross-platform, race, benchmark, generated-output, and release checks.
  • Source headers, repository metadata, line-ending normalization, markdown linting and license text were normalized.
  • ⚠️ breaking: default maximum long flag length is now 32. For longer names, configure parser limit explicitly via Parser.SetMaxLongNameLength(...).

Fixed

  • examples/basic/main.go now checks help errors via *flags.Error + errors.As.
  • Positional help rendering no longer panics for positional-only parsers or unicode positional names.
  • Generated man-page timestamps honor SOURCE_DATE_EPOCH in UTC.
  • Duplicate default tags and other invalid example metadata were removed.
  • Invalid env-provided choices values now report validation errors.

Removed

  • Legacy GitHub workflow and cross-compile shell script were replaced by the new CI/release workflow and Makefile targets.
  • Legacy standalone man-page implementation was removed in favor of the template-backed documentation renderer.