Merge pull request 'The build verb takes on and behind, the command's other two shapes' (#130) from feat/the-build-verb-takes-on-and-behind into main
This commit was merged in pull request #130.
This commit is contained in:
@@ -712,8 +712,19 @@ func (a *verbArguments) commandLine() ([]string, error) {
|
||||
}
|
||||
return []string{"module", "issue", str("module"), "--node", str("node")}, nil
|
||||
case "build":
|
||||
if err := need("repository"); err != nil {
|
||||
return nil, err
|
||||
// The command's three shapes (`build --on`, `build --behind`, `build <repository>`), one per
|
||||
// call: each branch reads only its own argument, so another given beside it is refused as
|
||||
// passed over rather than dropped. Asked and not waited for, the same as a single build.
|
||||
if b := str("on"); b != "" {
|
||||
return []string{"build", "--on", b, "--wait", "0"}, nil
|
||||
}
|
||||
if on("behind") {
|
||||
return []string{"build", "--behind", "--wait", "0"}, nil
|
||||
}
|
||||
if a.given["repository"] == "" {
|
||||
// No shape named: the command says its usage, which names all three — the answer the
|
||||
// caller needs, and the same as `rotate` given neither of its shapes.
|
||||
return []string{"build"}, nil
|
||||
}
|
||||
// Not waited for: a tool call cannot hold a connection for the minutes a build takes; the
|
||||
// daemon takes the outcome in when it comes and the id follows the build (issue 176). A
|
||||
|
||||
Reference in New Issue
Block a user