[flags] Minor updates

This commit is contained in:
Ciprian Dorin Craciun 2018-11-15 20:04:26 +02:00
parent 98607fdfe6
commit 2b86d7880c
2 changed files with 6 additions and 2 deletions

View file

@ -392,7 +392,7 @@ func main_0 () (error) {
_sourcesFolder_0 := _flags.String ("sources", "", "<path>") _sourcesFolder_0 := _flags.String ("sources", "", "<path>")
_archiveFile_0 := _flags.String ("archive", "", "<path>") _archiveFile_0 := _flags.String ("archive", "", "<path>")
_compress_0 := _flags.String ("compress", "", "gzip | brotli") _compress_0 := _flags.String ("compress", "", "gzip | brotli | identity")
_debug_0 := _flags.Bool ("debug", false, "") _debug_0 := _flags.Bool ("debug", false, "")
FlagsParse (_flags, 0, 0) FlagsParse (_flags, 0, 0)

View file

@ -31,8 +31,12 @@ func FlagsParse (_flags *flag.FlagSet, _argumentsMin uint, _argumentsMax uint) (
_arguments := os.Args[1:] _arguments := os.Args[1:]
if _error := _flags.Parse (_arguments); _error != nil { if _error := _flags.Parse (_arguments); _error != nil {
if _error == flag.ErrHelp {
os.Exit (0)
} else {
AbortError (_error, fmt.Sprintf ("[8fae7a93] failed parsing arguments: `%v`!", _arguments)) AbortError (_error, fmt.Sprintf ("[8fae7a93] failed parsing arguments: `%v`!", _arguments))
} }
}
_flagsNArg := uint (_flags.NArg ()) _flagsNArg := uint (_flags.NArg ())
if _argumentsMin == _argumentsMax { if _argumentsMin == _argumentsMax {