From f116178dcf8b450c76400e2a0fbd2991f2c227b4 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Fri, 5 Aug 2022 08:58:35 -0500 Subject: [wip] [refactor] [add] subcommands. --- app/util.lisp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/util.lisp (limited to 'app/util.lisp') 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))) -- cgit v1.2.3