| 1 | # A way that programs could annotate procs and external commands | 
| 2 | |
| 3 | hay define Sig | 
| 4 | |
| 5 | Sig grep { | 
| 6 | pure = true | 
| 7 | } | 
| 8 | |
| 9 | Sig foo { | 
| 10 | pure = false | 
| 11 | } | 
| 12 | |
| 13 | proc foo { | 
| 14 | echo 'where is my sig?' | 
| 15 | } | 
| 16 | |
| 17 | case ${1:-} { | 
| 18 | |
| 19 | # Is this a good pattern? | 
| 20 | # You have to run it twice, which is not great. | 
| 21 | |
| 22 | (''|sigs) | 
| 23 | json write (_hay()) | 
| 24 | ;; | 
| 25 | |
| 26 | ('procs') | 
| 27 | pp proc | 
| 28 | ;; | 
| 29 | |
| 30 | # TODO: would be nice to validate this | 
| 31 | (*) | 
| 32 | @ARGV | 
| 33 | ;; | 
| 34 | } | 
| 35 |