swift-argument-parser
swift-argument-parser copied to clipboard
Improved documentation for parseAsRoot
When I read "Manual Parsing and Testing" I got the impression that parseAsRoot would only ever return one of the Math subcommands but I discovered that that wasn't the case when I tried using it. When I went looking to find out why -h stopped working for me I found that a HelpCommand was returned by parseAsRoot. It worked in your example as you execute the run method of the command in the default case of the switch.
I believe that a short note to that effect would help others.
Also, in the example variance is calculated as the sum of the squared errors when it is actually the mean.