Skip to content

Commit

Permalink
Merge pull request #207 from sl-sh-dev/fix-docs-macro
Browse files Browse the repository at this point in the history
fix: docs macro no longer double-printing usage string
  • Loading branch information
StevenLove authored Oct 10, 2024
2 parents d71d454 + 0f7cf6f commit 4ad9459
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lisp/core.slosh
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ Section: core
%#
(defmacro doc (sym)
(let (docs `(get-prop ~sym :doc-string)
has-usage (str-starts-with "Usage:" (str-trim (str docs))))
has-usage `(str-starts-with (str-trim (str ~docs)) "Usage:"))
(do
(if has-usage
`(prn ~docs)
`(prn (str (usage ~sym) "\n\n" ~docs))))))
`(if ~has-usage
(prn ~docs)
(prn (str (usage ~sym) "\n\n" ~docs))))))

#%
Evaluate body a number of times equal to times' numerical value.
Expand Down

0 comments on commit 4ad9459

Please sign in to comment.