Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit a6989bc

Browse files
committed
Update comments on fields of struct
1 parent e5bea29 commit a6989bc

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/kssh/flags.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,24 @@ package kssh
33
import "fmt"
44

55
type CLIArgument struct {
6-
Name string // eg "--foo"
7-
HasArgument bool // true if an argument comes after it (eg "--foo bar") false if it is a boolean flag (eg "--help")
8-
Preserve bool // true if you wish to preserve this argument into the list of remaining arguments even if found
6+
// The name of the flag eg "--foo"
7+
Name string
8+
9+
// HasArgument:true if an argument comes after it (eg "--foo bar") false if it is a boolean flag (eg "--help")
10+
HasArgument bool
11+
12+
// Preserve:true if you wish to preserve this argument into the list of remaining arguments even if found
913
// eg if your command takes in a `-v` flag and the subcommand also takes in a `-v` flag
10-
// incompatible with HasArgument: true
14+
// incompatible with HasArgument: true but only because that has not been built
15+
Preserve bool
1116
}
1217

1318
type ParsedCLIArgument struct {
19+
// The CLIArgument that was found and parsed
1420
Argument CLIArgument
15-
Value string
21+
22+
// The value associated with it if HasArgument:true. Otherwise an empty string.
23+
Value string
1624
}
1725

1826
// ParseArgs parses os.Args for use with kssh. This is handwritten rather than using go's flag library (or

0 commit comments

Comments
 (0)