solutions: the guide is its own program, not part of yet
Default program name in messages is yetano-solutions; comments no longer describe mounting the commands into yet (owner decision 2026-12-01, docs/knowledge-solutions ADR-0006 in the meta-repo). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2481a0dd27
commit
5f6865faa2
3 files changed
+11
-15
No files matched your search
+5
-10
@@ -1,12 +1,7 @@
|
|||||||
// Package cli implements the guide's commands -- solution, task,
|
// Package cli implements the guide's commands -- solution, task,
|
||||||
// knowledge and open -- with yet's conventions (stdlib flag, --json on
|
// knowledge and open -- with yet's conventions (stdlib flag, --json on
|
||||||
// every command, data on stdout, messages on stderr, stable exit codes),
|
// every command, data on stdout, messages on stderr, stable exit codes).
|
||||||
// so yet mounts them with one case in its dispatcher:
|
// The guide's own program calls Run from main; yet does not embed it.
|
||||||
//
|
|
||||||
// case "solution", "task", "knowledge", "open":
|
|
||||||
// return cli.Run(ctx, args, env)
|
|
||||||
//
|
|
||||||
// The same package backs the standalone yetano-solutions binary.
|
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -45,7 +40,7 @@ type Env struct {
|
|||||||
// Interactive: stdin and stdout are a terminal. Without it no command
|
// Interactive: stdin and stdout are a terminal. Without it no command
|
||||||
// ever waits for input (CLI-03).
|
// ever waits for input (CLI-03).
|
||||||
Interactive bool
|
Interactive bool
|
||||||
// Program is the command name in messages ("yet" or "yetano-solutions").
|
// Program is the command name in messages.
|
||||||
Program string
|
Program string
|
||||||
// Catalogs are default catalog directories (an installed knowledge
|
// Catalogs are default catalog directories (an installed knowledge
|
||||||
// bundle); --catalog and $YETANO_SOLUTIONS_CATALOG come first.
|
// bundle); --catalog and $YETANO_SOLUTIONS_CATALOG come first.
|
||||||
@@ -86,7 +81,7 @@ func Run(ctx context.Context, args []string, env Env) int {
|
|||||||
env.Getenv = os.Getenv
|
env.Getenv = os.Getenv
|
||||||
}
|
}
|
||||||
if env.Program == "" {
|
if env.Program == "" {
|
||||||
env.Program = "yet"
|
env.Program = "yetano-solutions"
|
||||||
}
|
}
|
||||||
if env.Stdin == nil {
|
if env.Stdin == nil {
|
||||||
env.Stdin = os.Stdin
|
env.Stdin = os.Stdin
|
||||||
@@ -160,7 +155,7 @@ func (a *app) dispatch(args []string) error {
|
|||||||
return a.usage(cmd)
|
return a.usage(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Usage is the help text (also for yet's usage()).
|
// Usage is the help text.
|
||||||
const Usage = `Solutions Guide -- describe what you want to achieve, get native configuration:
|
const Usage = `Solutions Guide -- describe what you want to achieve, get native configuration:
|
||||||
|
|
||||||
solution list|search|show|setup|generate|validate|plan|doctor
|
solution list|search|show|setup|generate|validate|plan|doctor
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func run(t *testing.T, store string, args ...string) result {
|
|||||||
var out, errb bytes.Buffer
|
var out, errb bytes.Buffer
|
||||||
code := Run(context.Background(), args, Env{
|
code := Run(context.Background(), args, Env{
|
||||||
Stdin: strings.NewReader(""), Stdout: &out, Stderr: &errb,
|
Stdin: strings.NewReader(""), Stdout: &out, Stderr: &errb,
|
||||||
Program: "yet", StoreDir: store, Catalogs: []string{"../engine/testdata/cat"},
|
Program: "yetano-solutions", StoreDir: store, Catalogs: []string{"../engine/testdata/cat"},
|
||||||
Getenv: func(string) string { return "" },
|
Getenv: func(string) string { return "" },
|
||||||
})
|
})
|
||||||
return result{code, out.String(), errb.String()}
|
return result{code, out.String(), errb.String()}
|
||||||
@@ -132,7 +132,7 @@ func TestInteractiveWizard(t *testing.T) {
|
|||||||
// size: Enter (default small), hosts: a.example.org, then actions: 6 export, 8 quit
|
// size: Enter (default small), hosts: a.example.org, then actions: 6 export, 8 quit
|
||||||
in := strings.NewReader("\na.example.org\n6\n8\n")
|
in := strings.NewReader("\na.example.org\n6\n8\n")
|
||||||
code := Run(context.Background(), []string{"solution", "setup", "app-run", "--output", out}, Env{
|
code := Run(context.Background(), []string{"solution", "setup", "app-run", "--output", out}, Env{
|
||||||
Stdin: in, Stdout: &o, Stderr: &e, Interactive: true, Program: "yet", StoreDir: store,
|
Stdin: in, Stdout: &o, Stderr: &e, Interactive: true, Program: "yetano-solutions", StoreDir: store,
|
||||||
Catalogs: []string{"../engine/testdata/cat"}, Getenv: func(string) string { return "" },
|
Catalogs: []string{"../engine/testdata/cat"}, Getenv: func(string) string { return "" },
|
||||||
})
|
})
|
||||||
if code != 0 {
|
if code != 0 {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// Command yetano-solutions runs the Solutions Guide commands on their own
|
// Command yetano-solutions runs the Solutions Guide commands (CI of the
|
||||||
// (CI of the catalog, development). In a normal installation the same
|
// catalog, development). The guide is deliberately not part of yet, which
|
||||||
// commands are part of yet: yet solution, yet task, yet knowledge, yet open.
|
// stays a general tool; the full program with TUI and GUI moves to its
|
||||||
|
// own repository (docs/knowledge-solutions ADR-0006).
|
||||||
//
|
//
|
||||||
// yetano-solutions solution list --catalog assets/solutions
|
// yetano-solutions solution list --catalog assets/solutions
|
||||||
package main
|
package main
|
||||||
|
|||||||
Reference in new issue
Block a user