fix: allow absolute paths for the 'dir' command (#3186)
parent
0320ba387b
commit
1244cc518d
|
|
@ -40,7 +40,13 @@ func newArgs(p *Interpreter, aa []string) args {
|
|||
}
|
||||
|
||||
case strings.Index(a, filterFlag) == 0:
|
||||
args[filterKey] = strings.ToLower(a[1:])
|
||||
if p.IsDirCmd() {
|
||||
if _, ok := args[topicKey]; !ok {
|
||||
args[topicKey] = a
|
||||
}
|
||||
} else {
|
||||
args[filterKey] = strings.ToLower(a[1:])
|
||||
}
|
||||
|
||||
case strings.Contains(a, labelFlag):
|
||||
if ll := ToLabels(a); len(ll) != 0 {
|
||||
|
|
|
|||
|
|
@ -242,11 +242,18 @@ func TestDirCmd(t *testing.T) {
|
|||
"toast-nodir": {
|
||||
cmd: "dir",
|
||||
},
|
||||
|
||||
"caps": {
|
||||
cmd: "dir DirName",
|
||||
ok: true,
|
||||
dir: "DirName",
|
||||
},
|
||||
|
||||
"abs": {
|
||||
cmd: "dir /tmp",
|
||||
ok: true,
|
||||
dir: "/tmp",
|
||||
},
|
||||
}
|
||||
|
||||
for k := range uu {
|
||||
|
|
|
|||
Loading…
Reference in New Issue