Skip to content

Commit

Permalink
Merge pull request #269 from rsteube/spec-documentation
Browse files Browse the repository at this point in the history
spec: add documentation fields
  • Loading branch information
rsteube authored Mar 3, 2024
2 parents f296080 + 58b07bb commit 76c9a66
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 76c9a66

Please sign in to comment.