This repository was archived by the owner on Jan 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,16 +3,24 @@ package kssh
33import "fmt"
44
55type 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
1318type 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
You can’t perform that action at this time.
0 commit comments