2013-06-29 23:56:58 +02:00
|
|
|
#!/usr/bin/env hy
|
2017-04-27 23:16:57 +02:00
|
|
|
;; Copyright 2017 the authors.
|
|
|
|
;; This file is part of Hy, which is free software licensed under the Expat
|
|
|
|
;; license. See the LICENSE.
|
2013-06-29 23:56:58 +02:00
|
|
|
|
|
|
|
(import sys)
|
|
|
|
(import argparse)
|
|
|
|
|
|
|
|
(setv parser (argparse.ArgumentParser))
|
|
|
|
|
|
|
|
(.add_argument parser "-i")
|
|
|
|
(.add_argument parser "-c")
|
|
|
|
|
|
|
|
(setv args (.parse_args parser))
|
|
|
|
|
|
|
|
;; using (cond) allows -i to take precedence over -c
|
|
|
|
|
2013-09-29 18:00:24 +02:00
|
|
|
(cond [args.i
|
|
|
|
(print (str args.i))]
|
|
|
|
[args.c
|
|
|
|
(print (str "got c"))])
|