forked from joejulian/gio-cmd
gogio: refuse compilation with additional arguments
Previously, it was possible to misuse gigio with arguments after the package, such as `gogio -target android . -o foo.apk`. That cause an undesired effect, since `-o` is silently ignore by gogio. Now, any arguments after the package will trigger an error. Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
@@ -65,6 +65,9 @@ func flagValidate() error {
|
||||
if pkgPathArg == "" {
|
||||
return errors.New("specify a package")
|
||||
}
|
||||
if len(flag.Args()) > 1 {
|
||||
return fmt.Errorf("build arguments must be specified before the package (%q)", pkgPathArg)
|
||||
}
|
||||
if *target == "" {
|
||||
return errors.New("please specify -target")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user