I want my command to work like this:
mytool --ios # do iOS
mytool --macos. # do macOS
mytool # must choose either --ios or --macos
I think this can be done with:
enum OSType: ExpressibleByArgument {
case ios, macos
init?(argument: String) {
if "ios" == argument {
self = .ios
} else if "macos" == argument {
self = .macos
} else {
return nil
}
}
}
// ... the in my command:
@Argument(help: "Enter either --ios or --macOS (<== this doesn't work, how to enter?")
var ostype: OSType
Am I doing the correctly? And how to use my Argument
?