Skip to content

Commit

Permalink
Fix printing version from parent command
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed May 15, 2023
1 parent cb0054b commit d8e4dfd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/command.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,11 @@ _~~A() {
;; If this is a sub-command and we don't have a version string,
;; then try to find a version string from some of the parent
;; commands.
(let ((cmd-with-version (some (lambda (item)
(and (command-version item) item))
(command-lineage command))))
(print-version cmd-with-version t)
(let ((cmd (some (lambda (item)
(and (command-version item) item))
(command-lineage command))))
(when cmd
(print-version cmd t))
(error 'exit-error :code 0)))
((getopt command :clingon.help.flag)
(print-usage command t)
Expand Down

0 comments on commit d8e4dfd

Please sign in to comment.