Skip to content

Commit

Permalink
update code documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Oct 6, 2021
1 parent 51adc6d commit b85b2c1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (

// Ctx holds the invokation context of
// a command.
//
// The Ctx must not be stored or used
// after command execution.
type Ctx struct {
ObjectMap

Expand Down Expand Up @@ -144,6 +147,9 @@ type SubCommandHandler struct {
// with the called sub command name and scopes the
// command options to the options of the called
// sub command.
//
// The SubCommandCtx must not be stored or used
// after command execution.
type SubCommandCtx struct {
*Ctx

Expand All @@ -165,8 +171,8 @@ func (c *SubCommandCtx) Options() CommandOptions {
// If the call occured, the passed handler function is
// getting passed the scoped sub command Ctx.
//
// The SubCommandCtx passed must not be stored after
// handler execution.
// The SubCommandCtx passed must not be stored or used
// after command execution.
func (c *Ctx) HandleSubCommands(handler ...SubCommandHandler) (err error) {
for _, h := range handler {
opt := c.Options().Get(0)
Expand Down

0 comments on commit b85b2c1

Please sign in to comment.