diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-05 08:58:35 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-05 08:58:35 -0500 |
commit | f116178dcf8b450c76400e2a0fbd2991f2c227b4 (patch) | |
tree | 67fcc6a6e7035eb0b1929e495bceca2dc4fa564b /app/util.lisp | |
parent | 5c590a614544c977964692e41b0e5c19043b142c (diff) |
[wip] [refactor] [add] subcommands.
Diffstat (limited to 'app/util.lisp')
-rw-r--r-- | app/util.lisp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/util.lisp b/app/util.lisp new file mode 100644 index 0000000..d9d5ea2 --- /dev/null +++ b/app/util.lisp @@ -0,0 +1,11 @@ +;;;; utils.lisp + +(in-package :oneliners.cli.app) + +(defun parse-identifier (str) + "If STR holds digits representing an integer, parse them. otherwise + return the string. Oneliner identifiers may be names or ID + numbers. Returns NIL in the case that STR is NIL" + (when str + (or (parse-integer str :junk-allowed t) + str))) |