aboutsummaryrefslogtreecommitdiff
path: root/app/util.lisp
blob: d9d5ea246bd42580bc752de7e9dbb92c3e56f81a (plain)
1
2
3
4
5
6
7
8
9
10
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)))