List register and switch in the help, and none of the removed commands (issue 1851 A11a, A11b)
The help still offered build, rebuild and replay --register, each now refused as removed, and did not name the terminal's register.
This commit is contained in:
@@ -237,8 +237,8 @@ func run() error {
|
||||
}
|
||||
}
|
||||
|
||||
func usage() {
|
||||
fmt.Fprint(os.Stderr, `mesh-controller — the control plane
|
||||
// usageText is the terminal's help: every command it has, and none it refuses as removed (removedByName).
|
||||
var usageText = `mesh-controller — the control plane
|
||||
|
||||
On a node the operator types these as 'mesh-cli <command>' (in zsh, 'nox <command>'): asked
|
||||
through the node's engine, and run as the controller's terminal only on the control-node
|
||||
@@ -312,15 +312,14 @@ func usage() {
|
||||
operator key make [--out <file>] make the operator's sealing key, off the mesh; private half to the file only
|
||||
operator key set <public> [--replace] tell the mesh which operator key to seal to
|
||||
operator key show the operator key, and what it can recover
|
||||
build <repository> [--ref R] have a build machine build it, and record what came out
|
||||
build --behind build every module the mesh holds older than its source
|
||||
build --on <module> rebuild every module that stands on this module's artifacts, bases first
|
||||
register <module> <owner>/<repository> <path> register a module from a repository the catalogue does not
|
||||
build, from the builder's done key of its fingerprint (ADR 0501 §4)
|
||||
switch [--json] the switch's list: each module, the build it runs, and what the builder holds
|
||||
builds [<module>] what has been built lately, and what came of it
|
||||
queue [--json] every ask in the build queue: waiting, in flight (where, how long), dead
|
||||
cancel <id> drop a waiting or dead ask; recorded failed, cancelled by hand
|
||||
clear [--dead] cancel every waiting ask (and the dead ones); never one in flight
|
||||
rebuild <module|build-id> ask the module's source again, or that build's, under a new id
|
||||
replay <build-id> [--register [--older]] that build's commit again; a dry run unless --register
|
||||
replay <build-id> that build's commit again, a dry run: what a build of it makes
|
||||
kill <id> end a build where it runs; recorded failed, killed by hand
|
||||
pause [<node>] / resume [<node>] the build seat's holder there, or every holder, takes nothing new / again
|
||||
plans retry <id> ask a failed plan's failed builds again, and carry the plan on
|
||||
@@ -355,10 +354,13 @@ func usage() {
|
||||
version what this binary is
|
||||
|
||||
Each context reaches its own store through its own credential (novox/hq ADR 0008), named
|
||||
`+store.Variable("<context>")+` — or `+store.FileVariable("<context>")+`, naming a file that holds
|
||||
` + store.Variable("<context>") + ` — or ` + store.FileVariable("<context>") + `, naming a file that holds
|
||||
the same thing and keeps the password out of the environment. This process holds:
|
||||
|
||||
`)
|
||||
`
|
||||
|
||||
func usage() {
|
||||
fmt.Fprint(os.Stderr, usageText)
|
||||
for _, c := range held {
|
||||
fmt.Fprintf(os.Stderr, " %-12s database %-12s from %s\n",
|
||||
c.name, store.Database(c.name), store.Variable(c.name))
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// C3 (issue 1851 A11a, A11b, A13; ADR 0501 §4, §5): the terminal's help lists no command it refuses as removed, and lists
|
||||
// the ones R4e added: `register` and `switch`.
|
||||
func TestTheHelpListsNoRemovedCommandAndTheNewOnes(t *testing.T) {
|
||||
for _, removed := range []string{"build", "rebuild", "forget-checks", "delivery plan"} {
|
||||
if regexp.MustCompile(`(?m)^ `+regexp.QuoteMeta(removed)+` `).MatchString(usageText) {
|
||||
t.Errorf("the help still lists %q, which is refused as removed", removed)
|
||||
}
|
||||
}
|
||||
if strings.Contains(usageText, "--register") {
|
||||
t.Error("the help still lists replay --register, which is refused as removed")
|
||||
}
|
||||
for _, added := range []string{"register <module> <owner>/<repository> <path>", "switch [--json]"} {
|
||||
if !strings.Contains(usageText, " "+added) {
|
||||
t.Errorf("the help does not list %q", added)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user