Encountered this myself. Pretty nasty. The error message is totally unhelpful, so I spent a couple of hours trying to figure out what was wrong with my @Options and @Flags. Only when I started putting breakpoints in the ArgumentParser library itself, on the error message line, did I discover the problem was a var that was not even marked as a argument.
Even when you discover that problem, it is a bit nasty: you can change to a "let" property, but then the compiler throws up warnings about them being ignored during coding. If you use a var, argument parser doesn't work.
It would at least be very useful if the name of the non-argument property that is causing the issue were named in the error message. For some reason it doesn't print, leaving the user in the dark.
Hello interested parties — the newest release (0.4.0) includes a change that allows var properties that aren't declared with a parsing property wrapper. Please try it out and open an issue if you have any problems!
Hello @nnnnnnnn do you have an example of that change you mentioned in 0.4.0 ?
I am using 1.2.3 now and when I have a var attribute that is not an @Option, I receive this error at the struct level : Type 'GenerateToken' does not conform to protocol 'Decodable'
Here is the offending line in my AsyncParsableCommand struct:
// initialize logger
var log : Logger = Logger(label: "generate-token")