Release v0.1.0
·
91 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
Added
- Shell completion script generation via
Parser.WriteCompletion(...),Parser.WriteNamedCompletion(...), andParser.WriteAutoCompletion(...)for bash, zsh, and pwsh. Completion output includes command/option aliases, optionchoices,completiontag hints (file,dir,none) for options/positionals, bool value candidates whenAllowBoolValuesis enabled, and no-space handling for inline option values. Shell auto-detection (zsh/pwsh) falls back tobashwhen 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 helpersListBuiltinTemplates(...)/WriteBuiltinTemplate(...). - Opt-in i18n for built-in help, errors, version output, generated docs, INI examples, completion descriptions, and user-facing metadata through
*-i18ntags, 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, andVersionFieldsfield 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,PrintErrorsOnStdoutandPrintHelpOnInputErrors. - 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, andconfigcommands viaHelpCommand,VersionCommand,CompletionCommand,DocsCommand,ConfigCommand, and theHelpCommandsconvenience 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, andConfiguredValues. - Environment provisioning helpers:
Parser.SetEnvPrefix(...),EnvProvisioning, and per-optionauto-envopt-in/opt-out behavior. - Environment detection API for runtime hints:
DetectEnvironment(),DetectTTY(),DetectFileTTY(...),DetectWriterTTY(...), andDetectColorSupport(...). - Dynamic defaults via
DefaultProvider, plus support forencoding.TextMarshaler/encoding.TextUnmarshalerwith existingflags.Marshaler/flags.Unmarshalerprecedence. - Configurable option ordering through
Parser.SetOptionSort(...),Parser.SetOptionTypeOrder(...), and theordertag. - INI example rendering via
IniParser.WriteExample(...)andIniParser.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-difftogithub.com/google/go-cmp. ⚠️ breaking: minimum supported Go version increased from1.20to1.25.- Dependencies were modernized, including
golang.org/x/sys,golang.org/x/text, andgolang.org/x/term. - Built-in help rendering was overhauled: wrapping/alignment use display width, terminal width is detected through
x/termwith stdio fallback, choice lists and value placeholders adapt to available width, command option descriptions share the global description column, and width can be disabled withParser.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 maximumlongflag length is now32. For longer names, configure parser limit explicitly viaParser.SetMaxLongNameLength(...).
Fixed
examples/basic/main.gonow 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_EPOCHin UTC. - Duplicate
defaulttags and other invalid example metadata were removed. - Invalid env-provided
choicesvalues 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.