#!/usr/bin/guile !# (import (sph) (sph cli) (sph filesystem) (rnrs io ports) (sph alist) (sph list) (sph io) (sph fs-perm config)) (define (fs-perm-set-cli) (let (arguments ( (cli-create #:description (string-append fsp-description "\n see --about for more information") #:about fsp-about #:options (q ( (config #:names #\c #:value-required? #t #:description "path to a configuration file") (acl) (run) (dry-run) ((specifier path paths ...))))))) (alist-bind arguments (acl specifier path paths config run dry-run) (if specifier (let ( (paths (map path->full-path (pair path (or paths (list))))) (rule (list (if acl (list (q acl) specifier) specifier)))) (fsp-config-apply (map (l (a) (pair a rule)) paths) #:path-context "" #:dry-run? dry-run)) (let (eval-port (l (port) (let loop ((a (get-datum port))) (if (eof-object? a) #t (begin (fsp-config-apply-rule a "" (not run)) (loop (get-datum port))))))) (if config (call-with-input-file config eval-port) (eval-port (current-input-port)))))))) (fs-perm-set-cli)