aboutsummaryrefslogtreecommitdiffstats
path: root/CHANGELOG.md
blob: 1267fca3460f0add9afd6e3a922f65feb924200f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Changelog

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

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.6.0] - 2026-11-14

### Changed

- The module path is now `git.eugenetriguba.com/subcmd` (previously
  `git.sr.ht/~eugenetriguba/subcmd`).

## [0.5.0] - 2025-12-27

### Added

- `Flags()` method and package-level function to access the top-level FlagSet.
- `WithStdout(io.Writer)` option for configuring help/usage output.
- `WithStderr(io.Writer)` option for configuring error output.

### Changed

- `Registry` now owns its own FlagSet instead of using the global `flag.CommandLine`.
- `Execute` now parses flags internally. Callers no longer need to call `flag.Parse()`.
- `WithOutput(io.Writer)` now sets both stdout and stderr.
- Only help/usage output goes to stdout now. Error messages now go to stderr.
  Previously, all output was going to stdout.
- Invoking the help flag now results in a successful exit code of 0 rather than
  1.

### Fixed

- Top-level `-h` flag now displays available subcommands instead of empty output.

## [0.4.0] - 2025-12-27

### Added

- `WithOutput(io.Writer)` option for configuring registry output writer.
- `WithErrorHandling(flag.ErrorHandling)` option for configuring flag parse error handling.

### Changed

- `NewRegistry` now accepts functional options instead of relying on setter methods.

### Fixed

- Subcommand `-h` flag now displays the command's Usage() string instead of empty output.

### Removed

- `Registry.SetOutput` method - use `WithOutput` option with `NewRegistry` instead.
- Package-level `SetOutput` function - create a custom registry with `NewRegistry(WithOutput(w))`.

## [0.3.0] - 2025-12-27

### Added

- `ManHelpCommand(prefix)` - a help command that opens man pages instead of
  printing inline help. Uses the prefix to construct page names (e.g.,
  `prefix` for the main page, `prefix-subcommand` for subcommand pages).

## [0.2.0] - 2025-10-13

### Changed

- When no subcommands are specified, usage information and help text will be
  shown with an exit code of 1.

## [0.1.0] - 2025-10-13

- Initial Release