#! /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) ) )