diff --git a/go.mod b/go.mod index f8eac01..b7ff9ef 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/surdeus/goblin go 1.18 -require github.com/surdeus/gomtool v0.0.0-20230324163514-3199e25c3890 // indirect +require github.com/surdeus/gomtool v0.0.0-20230324173629-09da5dcd0204 // indirect diff --git a/go.sum b/go.sum index bc2c4cd..ee94565 100644 --- a/go.sum +++ b/go.sum @@ -16,3 +16,7 @@ github.com/surdeus/gomtool v0.0.0-20230324073313-c382bc403f8b h1:9IJVeXxRDTPlp12 github.com/surdeus/gomtool v0.0.0-20230324073313-c382bc403f8b/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= github.com/surdeus/gomtool v0.0.0-20230324163514-3199e25c3890 h1:mT4VDgCb2AgPfq2k4GfXI8O3I2sIjHJUaJwBvx95AYM= github.com/surdeus/gomtool v0.0.0-20230324163514-3199e25c3890/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= +github.com/surdeus/gomtool v0.0.0-20230324171804-d106f3a7c3da h1:Wm3ZbhHuH/26B4/vde1S/7t3UPdAXVH7aX1LmHtUTWw= +github.com/surdeus/gomtool v0.0.0-20230324171804-d106f3a7c3da/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= +github.com/surdeus/gomtool v0.0.0-20230324173629-09da5dcd0204 h1:eNKjFr0w81mb1d3i2P4uAEIzgc6VVTRJJy6BDWq2vK0= +github.com/surdeus/gomtool v0.0.0-20230324173629-09da5dcd0204/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= diff --git a/src/tool/awk/goawk.go b/src/tool/awk/goawk.go index 9c7135c..0e6ac28 100644 --- a/src/tool/awk/goawk.go +++ b/src/tool/awk/goawk.go @@ -73,6 +73,8 @@ func Run(flags *mtool.Flags) { // Parse command line arguments manually rather than using the // "flag" package, so we can support flags with no space between // flag and argument, like '-F:' (allowed by POSIX) + + // J's comment: nope, we will change it, lol. var progFiles []string var vars []string fieldSep := " " @@ -86,10 +88,10 @@ func Run(flags *mtool.Flags) { header := false argv0 := flags.UtilName() - args := flags.Args() + args := flags.AllArgs() var i int - for i = 1; i < len(args); i++ { + for i = 0; i < len(args); i++ { // Stop on explicit end of args or first arg not prefixed with "-" arg := args[i] if arg == "--" { @@ -181,7 +183,7 @@ func Run(flags *mtool.Flags) { // Any remaining args are program and input files args = args[i:] - + var src []byte var stdinBytes []byte // used if there's a parse error if len(progFiles) > 0 {