I've added improved error messages and hints for the case flag.NArg() > 1.
Assuming that the first entry of flag.Args is the file input, I check whether any of the following os.Args after the input start with -.
In this case, I guess that the user has specified flags after the input (which is not allowed) and therefore suggest to them an alternative command by putting the current file input to the end of the argument chain.
Otherwise - if no flag was found - I guess that the user tried to use multiple file names and print a hint that this is not allowed.
I've added improved error messages and hints for the case
flag.NArg() > 1
. Assuming that the first entry offlag.Args
is the file input, I check whether any of the followingos.Args
after the input start with-
. In this case, I guess that the user has specified flags after the input (which is not allowed) and therefore suggest to them an alternative command by putting the current file input to the end of the argument chain. Otherwise - if no flag was found - I guess that the user tried to use multiple file names and print a hint that this is not allowed.This should solve issue #160.