Repository navigation
Fix help text - #20
Merged
Merged
Conversation
The shell script printed lines 2 to 23 of itself as its usage: a range moved by hand each time the usage grew, and two lines too long in every version, so --help, -h and no arguments ended with a blank line and half a sentence of the comment after the usage. The Zig build's usage stopped before those lines, and COMPAT.md listed the difference as deliberate. Neither named -h or the --OPTION=VALUE forms, said that --compress-after is required or that --delete-after has no default, or gave an exit status but 75, and the default of --lock-timeout was in a sentence about the lock. Both said that rotate takes the runs older than DAYS, where it takes the runs at least DAYS old. The shell script's usage is now a quoted here-document, and the Zig build's usage_text holds the same text: each command, each of rotate's options in both forms with what it does and its default, the environment variables, and the exit statuses 0, 2 and 75, last. COMPAT.md lists the usage as kept. The suite reads the options from both parsers, the shell script's case patterns and the Zig build's comparisons of an argument, and checks that --help lists each of them, that each option that takes a value gives its default or says it is required, that --lock-timeout waits 600 seconds by default, and that the exit statuses are 0, 2 and 75. It checks that --help, -h and no arguments print the usage whole, with every paragraph ending in a full stop and the exit statuses last, and that --help exits 0 and names --lock-timeout, as eb-pipeline reads it. The differential run compares --help and -h, and passes a difference only while COMPAT.md lists its case among the deliberate differences. A unit test checks that usage_text gives default_lock_timeout, lock_busy_exit and cli.usage_exit.
The reference's synopsis and its exit status 0 named --help but not -h. They name both now, and the reference shows the usage under --help, as it shows the version line under --version. The suite checks that the example there is what --help prints, so a change to the usage that misses the reference fails. README.md said that rotate compresses and removes the runs older than DAYS. It says at least DAYS old, as the usage, the reference and the how-to do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shell script's
--helpprinted lines 2 to 23 of the script and stopped mid-sentence: a blank line and half of the comment after the usage. The Zig build's usage stopped earlier still, and COMPAT.md listed the difference as deliberate.Both builds now print the same complete usage, from a here-document in the shell script and from
usage_textin the Zig build: every option in both forms (-hand--OPTION=VALUEincluded) with its default, the environment variables, and the exit statuses 0, 2 and 75, last. The usage and the README now say thatrotatetakes the runs at least DAYS old. COMPAT.md lists the usage as kept.The suite reads the options from both parsers and checks that
--helplists each of them with its default or that it is required. A--help/-hdifferential compares the two builds, a Zig unit test ties the text todefault_lock_timeout,lock_busy_exitandcli.usage_exit, and--helpstill names--lock-timeout, as eb-pipeline's probe reads it.On the base, 8 of 9 of those checks fail for each build, and the differential has 3 differences. At this tip, the 8 pass and the differential differences are 0.