A simple way to store and modify command line executions.
Using cliarg
is as simple as adding struct tags. Values are marshalled in order.
type ExampleCliarg struct {
Arg string `cliarg:"arg"` // The arg tag places the value of the field in the command line
Option string `cliarg:"-o"` // An option tag places the tag on the command line, followed by the value of the field
Flag bool `cliarg:"-f"` // A flag tag either places the flag in the command line or not, based on the value of field, occurs if boolean
}
ExampleCliarg{"/bin/arg", "option", true}
Results
/bin/arg -o option -f