diff options
Diffstat (limited to 'antiformatter/antifmt.rkt')
-rw-r--r-- | antiformatter/antifmt.rkt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/antiformatter/antifmt.rkt b/antiformatter/antifmt.rkt new file mode 100644 index 0000000..d9f93af --- /dev/null +++ b/antiformatter/antifmt.rkt @@ -0,0 +1,27 @@ +#lang racket + +(require racket/cmdline) +(require "src/formatter.rkt") + +; (define mangle-parenthesis? (make-parameter #t)) +; (define mangle-newlines? (make-parameter #t)) + +(command-line + #:program "antifmt" + #:once-each + [("-p" "--mangle-parens") + "Toggle mangling of parenthesis: on by default" + (mangle-parens? #f)] + [("-i" "--mangle-indents") + "Toggle mangling of indentation: off by default" + (mangle-indents? #t)] + [("-n" "--mangle-newlines") + "Toggle mangling of newlines: on by default" + (mangle-newlines? #f)] + #:args (loc) + (display + (string-append ; what the fuck + (mangle (parameterize ([read-accept-lang #t] [read-accept-reader #t]) + (sequence->list (in-producer read eof + (open-input-file loc))))) + "\n"))) |