Skip to content

Commit

Permalink
Add a -i CLI option
Browse files Browse the repository at this point in the history
POSIX shells have a `-i` short option to force interactive mode. Some
programs, such as the `script` command, assume that option is recognized
by the shell it spawns. There isn't any reason elvish shouldn't silently
ignore that option.

Resolves #1292
  • Loading branch information
Kurtis Rader authored and xiaq committed Apr 20, 2021
1 parent a2ba33f commit df3e7a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/prog/prog.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func newFlagSet(stderr io.Writer, f *Flags) *flag.FlagSet {
fs.BoolVar(&f.BuildInfo, "buildinfo", false, "show build info and quit")
fs.BoolVar(&f.JSON, "json", false, "show output in JSON. Useful with -buildinfo.")

// The `-i` option is for compatibility with POSIX shells so that programs, such as the `script`
// command, will work when asked to launch an interactive Elvish shell.
fs.Bool("i", false, "force interactive mode; currently ignored")
fs.BoolVar(&f.CodeInArg, "c", false, "take first argument as code to execute")
fs.BoolVar(&f.CompileOnly, "compileonly", false, "Parse/Compile but do not execute")
fs.BoolVar(&f.NoRc, "norc", false, "run elvish without invoking rc.elv")
Expand Down

0 comments on commit df3e7a9

Please sign in to comment.