mirror of https://github.com/voidlizard/hbs2
43 lines
795 B
Plaintext
Executable File
43 lines
795 B
Plaintext
Executable File
#! /usr/bin/env -S hbs2-cli file
|
|
|
|
; # println *args
|
|
|
|
; # (println (grep (sym "-g") *args))
|
|
|
|
(match *args
|
|
( (list? [sym? store] ...)
|
|
(begin
|
|
(local optdef (kw -g 1 --group-key 1))
|
|
(local cli (cli:split optdef ...))
|
|
(local opts (nth 0 cli))
|
|
(local gk1 (lookup:uw --group-key opts))
|
|
(local gk2 (lookup:uw -g opts))
|
|
(local gk (car (filter [fn x . [not [nil? x]]] `[,gk1 ,gk2])))
|
|
(local fname (head (nth 1 cli)))
|
|
|
|
(local kwa `[ ,(if gk [list :gk gk] '() )
|
|
]
|
|
)
|
|
|
|
[local r
|
|
(if fname
|
|
(hbs2:tree:metadata:file kwa fname)
|
|
(hbs2:tree:metadata:stdin kwa))]
|
|
|
|
(display r)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
( (list? [sym? cat] ...)
|
|
(begin
|
|
(println "FUCKING CAT" space ...))
|
|
|
|
)
|
|
|
|
( _ (--help) )
|
|
)
|
|
|
|
|