~eliasnaur/gio-cmd

35e56c5af956ac30e77e468f1c0a70083a2e29b2 — Inkeliz 1 year, 7 months ago 6826ef0
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>
1 files changed, 3 insertions(+), 0 deletions(-)

M gogio/main.go
M gogio/main.go => gogio/main.go +3 -0
@@ 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")
	}