Since autolisp overwrites with the last defun,
if there may or may not be arguments,
it is recommended to receive arguments as a list as in the answer to the link,
then check the list and process it with cond or if.
or
I don't know the detailed routine,
but if there are multiple argument cases, like below.
(defun c:mainroutine ( / ss ssl arg )
(defun subroutine1 ( / )
(princ "\n case 1 selected - 1 ea")
)
(defun subroutine2 ( a / )
(princ "\n case 2 selected - ")
(princ a)
(princ " ea")
)
(if (setq ss (ssget))
(progn
(if (> (setq ssl (sslength ss)) 1)
(setq arg 2)
(setq arg 1)
)
(cond
((= arg 1)
(subroutine1)
)
((= arg 2)
(subroutine2 ssl)
)
)
)
)
(princ)
)
However, if it is simply because of the bracket,
rather than dividing defun like this,
I think it would be better to create a separate routine according to the textstring using cond. in one main routine.