File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -843,9 +843,13 @@ Returns COMMAND-LINE with options removed."
843843 (when (string= term "--help")
844844 (when (and (null command) command-line (assq (intern (car command-line)) eldev--commands))
845845 (setf command (intern (car command-line))))
846- (signal 'eldev-quit (if command (eldev-help (symbol-name command)) (eldev-help))))
846+ (if command
847+ (eldev-help (symbol-name command))
848+ (eldev-help))
849+ (signal 'eldev-quit 0))
847850 (when (and (null command) (string= term "--version"))
848- (signal 'eldev-quit (apply #'eldev-version command-line)))
851+ (apply #'eldev-version command-line)
852+ (signal 'eldev-quit 0))
849853 (signal 'eldev-wrong-command-usage `(t "Unknown option `%s'" ,term)))))
850854 (if long-option
851855 (setf term nil)
Original file line number Diff line number Diff line change 99 stdout))
1010 (should (= exit-code 0 ))))
1111
12+ ; ; While `--help' is not advertised, we silently support it.
1213(ert-deftest eldev-help-2 ()
1314 (eldev--test-run " empty-project" (" --help" )
1415 (should (string-prefix-p (eldev--test-in-project-environment (eldev--test-first-line (eldev--test-capture-output (eldev-help))))
Original file line number Diff line number Diff line change 5555 (should (string= stdout (format " eldev %s \n " (eldev-message-version (eldev-find-package-descriptor 'eldev )))))
5656 (should (= exit-code 0 )))))
5757
58+ ; ; https://github.com/doublep/eldev/issues/21#issuecomment-688208274
59+ ; ;
60+ ; ; While `--version' is not advertised, we silently support it. It is supposed not only
61+ ; ; to work as `version' command, but also exit with success code, which it didn't.
62+ (ert-deftest eldev-own-version-8 ()
63+ (let ((eldev--test-project " empty-project" ))
64+ (eldev--test-delete-cache)
65+ (eldev--test-run nil (" --version" )
66+ (should (string= stdout (format " eldev %s \n " (eldev-message-version (eldev-find-package-descriptor 'eldev )))))
67+ (should (= exit-code 0 )))))
68+
5869(ert-deftest eldev-own-version-missing-dependency-1 ()
5970 (let ((eldev--test-project " missing-dependency-a" ))
6071 (eldev--test-delete-cache)
You can’t perform that action at this time.
0 commit comments