35 lines
845 B
Go
35 lines
845 B
Go
package exec_extra
|
|
|
|
var (
|
|
StructTagCmdArgs string = "cmdarg"
|
|
)
|
|
|
|
var (
|
|
/*
|
|
CmdArgsOptPreferShort, if specified, prefers the "short" argument over "long" if both are specified.
|
|
The default is to prefer long.
|
|
|
|
Can be specified per-field via the `prefer_short` option (no value/value ignored).
|
|
*/
|
|
CmdArgsOptPreferShort cmdArgOpt = func(opts *cmdArgsOpts) (err error) {
|
|
opts.preferShort = true
|
|
return
|
|
}
|
|
|
|
/*
|
|
CmdArgsOptShortEquals, if specified, renders short flags *with* an equals sign
|
|
(if using POSIX args).
|
|
|
|
Has no effect if using Windows traditional syntax or if there is no value for the field.
|
|
*/
|
|
CmdArgsOptShortEquals cmdArgOpt = func(opts *cmdArgsOpts) (err error) {
|
|
opts.preferShort = true
|
|
return
|
|
}
|
|
|
|
CmdArgsOptLongNoEquals cmdArgOpt = func(opts *cmdArgsOpts) (err error) {
|
|
opts.preferShort = true
|
|
return
|
|
}
|
|
)
|