проектные команды и ссылки на источник
- заведён internal/source: уровни ссылаются друг на друга путём на диске или git-репозиторием, ревизия закрепляется хвостом #ref; клон делается заново и удаляется, кэша нет - добавлены init, add, pull, list, check в проекте — манифест .conventions.toml, сборка копий по разу на компонент, маркер локальной части, READING.md рядом - проверки формы развязаны с набором: принимают lang.Vocabulary, а язык копии узнаётся по строке о версии — манифеста рядом с ней нет
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"git.vakhrushev.me/av/convy/internal/doc"
|
||||
"git.vakhrushev.me/av/convy/internal/lang"
|
||||
@@ -22,7 +23,7 @@ func runSuiteList(env Env, args []string) ExitCode {
|
||||
root := fs.String("root", "", "root of the suite; by default it is looked up upwards")
|
||||
topic := fs.String("topic", "", "show one topic only")
|
||||
langAxis := fs.String("lang", "", "language of the component, to show what it would take")
|
||||
stackAxis := fs.String("stack", "", "stack of the component, to show what it would take")
|
||||
stackAxis := fs.String("stack", "", "stack of the component, comma-separated, to show what it would take")
|
||||
retired := fs.Bool("retired", false, "show the retired names instead of the live ones")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return Usage
|
||||
@@ -60,7 +61,7 @@ func runSuiteList(env Env, args []string) ExitCode {
|
||||
}
|
||||
|
||||
selecting := *langAxis != "" || *stackAxis != ""
|
||||
component := suite.Component{Lang: *langAxis, Stack: *stackAxis}
|
||||
component := suite.Component{Lang: split(*langAxis), Stack: split(*stackAxis)}
|
||||
for i, name := range topics {
|
||||
if i > 0 {
|
||||
fmt.Fprintln(env.Out)
|
||||
@@ -141,6 +142,19 @@ func listRetired(w io.Writer, s *suite.Suite) {
|
||||
fmt.Fprintln(w, "\nnone of these names is ever handed out again")
|
||||
}
|
||||
|
||||
// split reads a comma-separated list off the command line. An axis of a
|
||||
// component is a list — a component may sit on two stacks at once — and one
|
||||
// flag repeated is worse to type than one flag with commas in it.
|
||||
func split(value string) []string {
|
||||
var out []string
|
||||
for _, part := range strings.Split(value, ",") {
|
||||
if part = strings.TrimSpace(part); part != "" {
|
||||
out = append(out, part)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func sortedKeys(m map[string]string) []string {
|
||||
keys := make([]string, 0, len(m))
|
||||
for k := range m {
|
||||
|
||||
Reference in New Issue
Block a user