OILS / spec / testdata / config / annotate-commands.oil View on Github | oilshell.org

35 lines, 25 significant
1# A way that programs could annotate procs and external commands
2
3hay define Sig
4
5Sig grep {
6 pure = true
7}
8
9Sig foo {
10 pure = false
11}
12
13proc foo {
14 echo 'where is my sig?'
15}
16
17case ${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