dagger do: Improve help message
- Only print first line of comment - Add "Available Options" section header Fixes #1777 Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -5,12 +5,11 @@ import (
|
||||
)
|
||||
|
||||
type Action struct {
|
||||
Name string
|
||||
Hidden bool
|
||||
Path cue.Path
|
||||
Comment string
|
||||
Children []*Action
|
||||
// pkg string
|
||||
Name string
|
||||
Hidden bool
|
||||
Path cue.Path
|
||||
Documentation string
|
||||
Children []*Action
|
||||
}
|
||||
|
||||
func (a *Action) AddChild(c *Action) {
|
||||
|
19
plan/plan.go
19
plan/plan.go
@@ -199,9 +199,7 @@ func (p *Plan) fillAction() {
|
||||
if !actions.Exists() {
|
||||
return
|
||||
}
|
||||
for _, cg := range actions.Doc() {
|
||||
p.action.Comment += cg.Text()
|
||||
}
|
||||
p.action.Documentation = actions.DocSummary()
|
||||
|
||||
tasks := flow.Tasks()
|
||||
|
||||
@@ -214,17 +212,12 @@ func (p *Plan) fillAction() {
|
||||
a := prevAction.FindByPath(path)
|
||||
if a == nil {
|
||||
v := p.Source().LookupPath(path)
|
||||
childComment := ""
|
||||
for _, cg := range v.Doc() {
|
||||
childComment += cg.Text()
|
||||
}
|
||||
|
||||
a = &Action{
|
||||
Name: s.String(),
|
||||
Hidden: s.PkgPath() != "",
|
||||
Path: path,
|
||||
Comment: childComment,
|
||||
Children: []*Action{},
|
||||
Name: s.String(),
|
||||
Hidden: s.PkgPath() != "",
|
||||
Path: path,
|
||||
Documentation: v.DocSummary(),
|
||||
Children: []*Action{},
|
||||
}
|
||||
prevAction.AddChild(a)
|
||||
}
|
||||
|
Reference in New Issue
Block a user