diff --git a/pkg/shell/shell.go b/pkg/shell/shell.go index daa8ff02d..94b7eb092 100644 --- a/pkg/shell/shell.go +++ b/pkg/shell/shell.go @@ -53,10 +53,12 @@ type Program struct { } func (p *Program) RegisterFlags(fs *prog.FlagSet) { - // Support -i so that programs that expect shells to support it (like - // "script") don't error when they invoke Elvish. + // script(1) (and possibly other programs) assume shells support -i fs.Bool("i", false, - "A no-op flag, introduced for POSIX compatibility") + "A no-op flag, introduced for compatibility") + // termux (and possibly other programs) assume shells support -l + fs.Bool("l", false, + "A no-op flag, introduced for compatibility") fs.BoolVar(&p.codeInArg, "c", false, "Treat the first argument as code to execute") fs.BoolVar(&p.compileOnly, "compileonly", false, diff --git a/pkg/shell/shell_test.elvts b/pkg/shell/shell_test.elvts index 018d34ab9..e1b7be076 100644 --- a/pkg/shell/shell_test.elvts +++ b/pkg/shell/shell_test.elvts @@ -1,5 +1,12 @@ //each:elvish-in-global +/////////////// +# no-op flags # +/////////////// + +~> elvish -i -l -c 'echo hello' +hello + ///////////////////// # XDG library paths # /////////////////////