In other prgraming languages there is typically a "getopt" type of function where you can do something along the lines of:
(if (= argument "--help")... but you often find yourself building a series of checks for the same type but as different configurations. Example:
(if (= argument "--help")...
(if (= argument "-help")...
(if (= argument "--H")...
(if (= argument "-H")...
(if (= argument "help")...
(if (= argument "HELP")...
(if (= argument "?")...
this quickly become so cumbersome (for the programmer) you find yourself only dealing with "standard" type of argument syntaxes like "--help, --h, etc." but this is also not very useful (for the end-user). The example I gave above (is very, very crude) is how I would deal with the "help check" to create a sort of "assert" type function check. I choose to use COND because of what it returns and how it evaluates vs the IF statement.
To make things a bit more generic you can build a set of simple check procedures which will deal with more situations.
;; -Support routines.
(equal result expected
))) (lambda ( process expected consequent
) ;; -Example usage.
;; (#assert "a" "1" '((princ "\nWrong argument") (princ)))
Now we can structure our code like this:
(if (#assert
"a" 1 '
((princ "\nI have been given the wrong argument type.") (princ))) (princ "\n \"a\" does equal 1 so I can run this portion of code now...") )
We can also do more complicated checks like this:
;; -Support function which will always return 1.
(defun myfunction
(argument
) 1)
;; -Run a check to make sure the return of `myfunction` is equal to 1...
'(myfunction "b")
1
'
((princ "\nI have been given the wrong argument type.") (princ))) ;; -if test passes, run the following prompt.
(princ "\n \"myfunction\" does equal 1 so I can run this portion of code now...") )
Not perfect, but this is the basis of an "assertion check".