diff options
| author | Jim Porter | 2022-01-19 18:59:23 -0800 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-01-21 13:06:11 +0100 |
| commit | 90de226e218883f2a62ce3e1ba9a79ef8e1be70c (patch) | |
| tree | 64790dd0034f28081c7a89f61d477500d3612911 /lisp/eshell/em-basic.el | |
| parent | a133af7c7f3aa2fd7fb4fea9c54cd082ed1481f3 (diff) | |
| download | emacs-90de226e218883f2a62ce3e1ba9a79ef8e1be70c.tar.gz emacs-90de226e218883f2a62ce3e1ba9a79ef8e1be70c.zip | |
Raise an error from 'eval-eval-using-options' for unknown options
* lisp/eshell/em-basic.el (eshell/echo): Add -E option.
* lisp/eshell/esh-opt.el (eshell--process-option): Raise an error if
an unknown option is encountered, even when :external is nil.
* test/lisp/eshell/esh-opt-tests.el (esh-opt-process-args-test)
(test-eshell-eval-using-options): Add test cases for this.
Diffstat (limited to 'lisp/eshell/em-basic.el')
| -rw-r--r-- | lisp/eshell/em-basic.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/eshell/em-basic.el b/lisp/eshell/em-basic.el index d3b15c900b7..ba868cee59e 100644 --- a/lisp/eshell/em-basic.el +++ b/lisp/eshell/em-basic.el | |||
| @@ -113,11 +113,16 @@ or `eshell-printn' for display." | |||
| 113 | "Implementation of `echo'. See `eshell-plain-echo-behavior'." | 113 | "Implementation of `echo'. See `eshell-plain-echo-behavior'." |
| 114 | (eshell-eval-using-options | 114 | (eshell-eval-using-options |
| 115 | "echo" args | 115 | "echo" args |
| 116 | '((?n nil (nil) output-newline "do not output the trailing newline") | 116 | '((?n nil (nil) output-newline |
| 117 | (?N nil (t) output-newline "terminate with a newline") | 117 | "do not output the trailing newline") |
| 118 | (?h "help" nil nil "output this help screen") | 118 | (?N nil (t) output-newline |
| 119 | "terminate with a newline") | ||
| 120 | (?E nil nil _disable-escapes | ||
| 121 | "don't interpret backslash escapes (default)") | ||
| 122 | (?h "help" nil nil | ||
| 123 | "output this help screen") | ||
| 119 | :preserve-args | 124 | :preserve-args |
| 120 | :usage "[-n | -N] [object]") | 125 | :usage "[OPTION]... [OBJECT]...") |
| 121 | (if eshell-plain-echo-behavior | 126 | (if eshell-plain-echo-behavior |
| 122 | (eshell-echo args (if output-newline (car output-newline) t)) | 127 | (eshell-echo args (if output-newline (car output-newline) t)) |
| 123 | ;; In Emacs 28.1 and earlier, "-n" was used to add a newline to | 128 | ;; In Emacs 28.1 and earlier, "-n" was used to add a newline to |