
This gets rid of the dichotomy between bootstrap.py and macros.hy, by making both files hy modules. I added some error checking to make the macros more resilient. The biggest (user-visible) change is the change in cond, which now only accepts lists as arguments. Tests updated accordingly. Closes: #176 (whoops, no more bootstrap)
19 lines
325 B
Hy
Executable File
19 lines
325 B
Hy
Executable File
#!/usr/bin/env hy
|
|
|
|
(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
|
|
|
|
(cond [args.i
|
|
(print (str args.i))]
|
|
[args.c
|
|
(print (str "got c"))])
|