Skip to content

Commit

Permalink
spec: add documentation fields
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 3, 2024
1 parent ff17f39 commit 58b07bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ type Command struct {
DashAny []string `yaml:"dashany,omitempty" json:"dashany,omitempty" jsonschema_description:"Dash completion of every other position"`
} `yaml:"completion,omitempty" json:"completion,omitempty" jsonschema_description:"Completion definition"`
Commands []Command `yaml:"commands,omitempty" json:"commands,omitempty" jsonschema_description:"Subcommands of the command"`

Documentation struct {
Command string `yaml:"command,omitempty" json:"command,omitempty" jsonschema_description:"Documentation of the command"`
Flag map[string]string `yaml:"flag,omitempty" json:"flag,omitempty" jsonschema_description:"Documentation of flags"`
Positional []string `yaml:"positional,omitempty" json:"positional,omitempty" jsonschema_description:"Documentation of positional arguments"`
PositionalAny string `yaml:"positionalany,omitempty" json:"positionalany,omitempty" jsonschema_description:"Documentation of other positional arguments"`
Dash []string `yaml:"dash,omitempty" json:"dash,omitempty" jsonschema_description:"Documentation of dash arguments"`
DashAny string `yaml:"dashany,omitempty" json:"dashany,omitempty" jsonschema_description:"Documentation of other dash arguments"`
} `yaml:"documentation,omitempty" json:"documentation,omitempty" jsonschema_description:"Documentation"`
Examples map[string]string `yaml:"examples,omitempty" json:"examples,omitempty" jsonschema_description:"Examples"`
}

func (c *Command) AddFlag(f Flag) {
Expand Down

0 comments on commit 58b07bb

Please sign in to comment.