46 lines
1.7 KiB
Go
46 lines
1.7 KiB
Go
package exec_extra
|
|
|
|
var (
|
|
/*
|
|
CmdArgsOptForcePosix forces the resulting command string to use "POSIX-style" flag notation.
|
|
|
|
Traditionally, Windows used flags like `/f` instead of POSIX `-f`, `/c:value` instead of `-c value`
|
|
or `-c=value`, etc.
|
|
|
|
If this option is passed, either to GetCmdFromStruct() or for a specific field via the
|
|
tag defined by StructTagCmdArgs (option `force_posix`, no value/value ignored), then the
|
|
POSIX-style flag syntax will be used instead.
|
|
|
|
Note that on Windows runtime, the default is to use the traditional slash-based syntax.
|
|
If you are generating command strings for Powershell or third-party software, you probably
|
|
want to use this option.
|
|
|
|
See also the inverse of this option, CmdArgsOptForceNoPosix.
|
|
*/
|
|
CmdArgsOptForcePosix cmdArgOpt = func(opts *cmdArgsOpts) (err error) {
|
|
opts.forcePosix = true
|
|
return
|
|
}
|
|
|
|
/*
|
|
CmdArgsOptForceNoPosix forces the resulting command string to use "traditional Windows" flag notation.
|
|
|
|
Traditionally, Windows used flags like `/f` instead of POSIX `-f`, `/c:value` instead of `-c value`
|
|
or `-c=value`, etc.
|
|
|
|
If this option is passed, either to GetCmdFromStruct() or for a specific field via the
|
|
tag defined by StructTagCmdArgs (option `force_no_posix`, no value/value ignored), then the
|
|
Windows-style flag syntax will be used instead.
|
|
|
|
Note that on Windows runtime, the default is to use the traditional slash-based syntax.
|
|
If you are generating command strings for Powershell or third-party software, you probably
|
|
want to use CmdArgsOptForcePosix instead.
|
|
|
|
See also the inverse of this option, CmdArgsOptForcePosix.
|
|
*/
|
|
CmdArgsOptForceNoPosix cmdArgOpt = func(opts *cmdArgsOpts) (err error) {
|
|
opts.forcePosix = false
|
|
return
|
|
}
|
|
)
|