feat(cli): torb new, init and upgrade parse their command line with std/cli #571
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/568-cli-new-init-upgrade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #568
Refs #124
Task
Step 4 of #124 (issue #568):
torb new,initandupgradeparse their command line withstd/cli, throughtorbCommand().What
declaration.trb: the three commands are declared (flags and values of--ciand--licensein the generated--help);scaffoldChoicesFromreads the flagsnewandinitshare (--ciand--licensechecked againstciValuesandlicenseValuesin the reader,--git/--no-gitgiveSome(true)/Some(false)/None);newOptionsFrom,initOptionsFrom,upgradeOptionsFrom.main.trb: the three*OptionsOffunctions and the old arms are gone, onematch parsed.pathcase each callsrunNew,runInit,runUpgradeas before.usage.trb: the threeCommandUsageblocks are gone;template.trb:scaffoldChoicesOf,ScaffoldParseandscaffoldFlagsare gone.--gitwith--no-git, a second directory oftorb newand a second version oftorb upgradeare refused instead of one silently winning;torb init <path>and a missing--channelname now get the generated errors.cli-declaration.test.trbhas groups for the three commands and their--help; thescaffoldChoicesOfgroup oftemplate.test.trbmoved there.tests/command-line/arguments.expectedchanges only on the lines ofnew,init,upgrade(plus two new lines:torb new,torb upgrade --channel). Docs: CLI.md status, std/cli page and its skill copy.Test
new,initandupgradeparse withstd/cli(step 4 of #124) #568f6daf4318177d10d5140new,initandupgradeparse withstd/cli(step 4 of #124) #568Review of
6b5c737(Closes #568, step 4 of #124).new/init/upgradeplus--helpassertions incli-declaration.test.trb; the removedscaffoldChoicesOfgroup moved there;arguments.expectedchanged only on the affected lines andtools/command-line.shgained the two new lines. CI green on this head (tier A, tier B, bootstrap, pdisc, gates).--ci/--licensechecks againstciValues/licenseValuesare kept with the command prefixed to the message.--git+--no-gitgive Some(true)/Some(false)/None. The one-directory rule ofnew, the one-version rule ofupgradeand the no-path rule ofinitare enforced. Dispatch inmain.trbgoes throughdeclaredCommands, and the old*OptionsOf,ScaffoldParseandscaffoldFlagshave no remaining users (CI builds).Non-blocking:
docs/standard-library/cli.mdline 40 is now longer than the surrounding wrap width.