Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ func (e *setExpr) eval(app *app, _ []string) {
return
}
gOpts.shellopts = strings.Split(e.val, ":")
case "shelldash", "noshelldash", "shelldash!":
err = applyBoolOpt(&gOpts.shelldash, e)
case "sizeunits":
switch e.val {
case "binary", "decimal":
Expand Down
2 changes: 2 additions & 0 deletions opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var gOpts struct {
shell string
shellflag string
shellopts []string
shelldash bool
showbinds bool
sizeunits string
smartcase bool
Expand Down Expand Up @@ -264,6 +265,7 @@ func init() {
gOpts.shell = gDefaultShell
gOpts.shellflag = gDefaultShellFlag
gOpts.shellopts = nil
gOpts.shelldash = true
gOpts.showbinds = true
gOpts.sizeunits = "binary"
gOpts.smartcase = true
Expand Down
6 changes: 5 additions & 1 deletion os.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ func shellCommand(s string, args []string) *exec.Cmd {
s = fmt.Sprintf("IFS='%s'; %s", gOpts.ifs, s)
}

args = append([]string{gOpts.shellflag, s, "--"}, args...)
if gOpts.shelldash {
args = append([]string{gOpts.shellflag, s, "--"}, args...)
} else {
args = append([]string{gOpts.shellflag, s}, args...)
}

args = append(gOpts.shellopts, args...)

Expand Down