From 7f47d4204039258cec78c767f489b7809b4257ff Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 Nov 2018 14:38:05 -0800 Subject: In-progress (but working) overhaul of some elements including: function calls, lib/thing.nom API, multi-assignments, varargs, etc. --- tools/autoformat.nom | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/autoformat.nom') diff --git a/tools/autoformat.nom b/tools/autoformat.nom index 3082a9e..8626c91 100755 --- a/tools/autoformat.nom +++ b/tools/autoformat.nom @@ -16,8 +16,9 @@ if (%args.1 is "-i"): %args::remove index 1 for %path in %args: + if (%path == "-"): %path = "stdin" for file %filename in %path: - unless (%filename::matches "%.nom$"): do next %filename + unless ((%filename::matches "%.nom$") or (%filename == "stdin")): do next %filename %contents = (read file %filename) %code = (NomsuCode from (Source %filename 1 (size of %contents)) %contents) %tree = (%code parsed) @@ -25,4 +26,4 @@ for %path in %args: if %inplace: write %formatted to file %filename ..else: - say %formatted + say %formatted inline -- cgit v1.2.3