Fixed AWKs wrong argument interpretation. Should replace their argument parsing with the standard one.;
This commit is contained in:
parent
d64be96052
commit
bbc33d3450
1 changed files with 4 additions and 1 deletions
|
@ -83,6 +83,8 @@ func Run(args []string) {
|
||||||
outputMode := ""
|
outputMode := ""
|
||||||
header := false
|
header := false
|
||||||
|
|
||||||
|
argv0 := args[0]
|
||||||
|
|
||||||
var i int
|
var i int
|
||||||
for i = 1; i < len(args); i++ {
|
for i = 1; i < len(args); i++ {
|
||||||
// Stop on explicit end of args or first arg not prefixed with "-"
|
// Stop on explicit end of args or first arg not prefixed with "-"
|
||||||
|
@ -177,6 +179,7 @@ func Run(args []string) {
|
||||||
// Any remaining args are program and input files
|
// Any remaining args are program and input files
|
||||||
args = args[i:]
|
args = args[i:]
|
||||||
|
|
||||||
|
fmt.Printf("args: %q\n", args)
|
||||||
var src []byte
|
var src []byte
|
||||||
var stdinBytes []byte // used if there's a parse error
|
var stdinBytes []byte // used if there's a parse error
|
||||||
if len(progFiles) > 0 {
|
if len(progFiles) > 0 {
|
||||||
|
@ -259,7 +262,7 @@ func Run(args []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
config := &interp.Config{
|
config := &interp.Config{
|
||||||
Argv0: filepath.Base(args[0]),
|
Argv0: filepath.Base(argv0),
|
||||||
Args: expandWildcardsOnWindows(args),
|
Args: expandWildcardsOnWindows(args),
|
||||||
Vars: []string{
|
Vars: []string{
|
||||||
"FS", fieldSep,
|
"FS", fieldSep,
|
||||||
|
|
Loading…
Reference in a new issue