Imagine a command like this
import ArgumentParser
struct Absolute: ParsableCommand {
@Argument() var number: Int
func run() throws {
print(abs(number))
}
}
Absolute.main()
you can run
and it works. but running
fails with Error: Missing expected argument '<number>' which makes sense.
I would have expected being able to pass the argument as "-5" but that doesn't work either.
Any advice on how to handle this?
Imagine a command like this
you can run
and it works. but running
fails with
Error: Missing expected argument '<number>'which makes sense.I would have expected being able to pass the argument as
"-5"but that doesn't work either.Any advice on how to handle this?