Skip to content

fix(cli): refuse a slip in --audience, refuse every argument alike, and close four small gaps in what a run says - #358

Merged
goldbarth merged 1 commit into
mainfrom
fix/command-line-small-things
Oct 8, 2026
Merged

goldbarth merged 1 commit into
mainfrom
fix/command-line-small-things

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Closes #353

Six small things from the manual run of 0.1.0-preview.4, one bullet each.

  • A slip in --audience is refused. --audience product, ran as --audience product, because empty places of a list were dropped, and --audience 1 ran as the customer audience, because Enum.TryParse reads a number as the value with that number. Both are refused now, as ADR 0005 asks: a name is one of the three words and nothing else. The list form itself, --audience technical,product, is documented in docs/cli.md and stays; the issue was wrong to list it.
  • Every refused argument prints the same two lines. preview --repo name-only printed the header of the run and then the error, generate --audience developers the error alone, and only an unknown option was followed by the pointer to the help. Now the value of --repo is judged with the other arguments (ReleaseTarget.CheckRepositoryOption), before the header, and all of them print their error and chartula --help lists every command and its options. A header opens a run that started.
  • chartula version is still an unknown command, and its line names chartula --version.
  • A blank line stands between the Wrote: list and 1 of 2 audiences failed., which read as an entry of that list.
  • The help of --plain says "NO_COLOR takes the colour only" in a sentence of its own. It read as a third case of plain output.
  • The rate limit message stands on its own. Without a token it said "see the warning at the start of the run", which a run prints and doctor does not. It now says what the warning said: "Without a token GitHub allows 60 requests an hour; a token in GITHUB_TOKEN raises that to 5000."
  • Docs: docs/cli.md shows the two lines of a refused value and says what a list with an empty place does; docs/github.md and docs/troubleshooting.md quote the new rate limit message.

Verified with the built CLI, before and after:

$ chartula preview --audience product, --repo name-only     # before: header, then the --repo error
--audience has a comma with no audience next to it. Name each one, such as --audience technical,product. There are three: technical, customer, product.
chartula --help lists every command and its options.
$ chartula preview --audience 1 --repo name-only            # before: header, then the --repo error
Unknown audience '1'. There are three: technical, customer, product.
chartula --help lists every command and its options.
$ chartula version
Unknown command 'version'. For the installed version, run chartula --version.

The doctor line was not run against a spent limit again; GitHubPullRequestReaderTests holds the message.

Tests: AudienceSelectionTests gain four lists with an empty place and three numbers; ArgumentCheckTests run the built CLI with four refused values and with version; ReleaseTargetTests hold the check of --repo from the arguments alone; ReleaseCommandOutputTests and GitHubPullRequestReaderTests expect the blank line and the new message. Full suite 1,056 passing, build without warnings.

…nd close four small gaps in what a run says
@goldbarth goldbarth self-assigned this Oct 8, 2026
@goldbarth
goldbarth merged commit ae989e1 into main Oct 8, 2026
4 checks passed
@goldbarth
goldbarth deleted the fix/command-line-small-things branch October 8, 2026 14:34
goldbarth added a commit that referenced this pull request Oct 8, 2026
Follows #360. Step 1 of `docs/development/releasing.md`.

- **Why now:** the manual run of `0.1.0-preview.4` on 2026-10-08 found
what a first user meets in the terminal, and six pull requests fixed it.
The binary people install is still preview.4, which has none of them,
and the terminal recording for the README (#325) and the model
comparison (#324) should show and measure the Chartula the announcement
describes.
- **What ships since preview.4,** 6 changes:
- the progress: the spinner next to its label and the header on the
column of the steps (#352), the line fitted to a narrow terminal (#356),
the step of an audience that did not render marked `× fail` (#359);
- the summary: a rendering shown for reading on a terminal, in the two
colours of the ramp (#360), a publishing run that says what became of
the release notes (#359), a blank line before the count of failed
audiences (#358);
- `doctor`: details broken between words with their indent (#356), a
rate limit message that stands on its own (#358);
- the command line: a slip in `--audience` refused, every refused
argument printed alike, `chartula version` told the flag (#358);
- the free check: a number with thousands separators read as one number
(#357).
- **Breaks to state in the notes,** as `docs/versioning.md` asks of a
preview:
- On a terminal the summary no longer prints a rendering as Markdown
source (#360). Redirected output, CI and `--plain` are unchanged, so a
script is not affected; a person who copied from the terminal copies
from the files or passes `--plain`.
- The header keys `Model:`, `GitHub:` and `Range:` are padded by one
more space (#352). A script that cuts the value at a fixed column needs
a look; one that reads past the key does not.
- `--audience product,` and `--audience 1` stop the run (#358); both ran
before, the second as the customer audience.
- A refused argument prints a second line, the pointer to the help, and
`--repo name-only` no longer prints the header first (#358).
- A publishing run without a technical rendering lists the release notes
under `Skipped` (#359), and the step of a failed audience reads `× fail`
where it read `· done`.
- The rule-based check reads `100,200` as one number (#357), so facts
that list three-digit numbers without a space no longer back each of
them.
- The csproj `Version` is the single source; nothing else carries the
number.

**After merge:** tag the merge commit on `main` with `v0.1.0-preview.5`
and push it; `release.yml` builds the draft, `chartula generate --tag
v0.1.0-preview.5` writes the notes into it with the settings
`releasing.md` names (`gpt-6.1-sol`, thinking `low`), and publishing
runs `install.yml`. The pinned `v0.1.0-preview.4` in `docs/ci.md` and
`docs/install.md`, and the template link in the `doctor` samples, move
to the new tag with the changelog pull request of step 6.

**Verified:** the built CLI prints `chartula 0.1.0-preview.5+<commit>`.

Tests: no test changed. Full suite 1,082 passing, build without
warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Small things the command line gets wrong before or after a run

1 participant