From 47db74229deaf281ad02c8305c4e4d4c8dbd3d7d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 19 Jul 2018 20:41:31 -0700 Subject: Fixed some bugs in trailing_line_len() and refactored tree_to_nomsu into separate inline/not-inline functions. --- tools/autoformat.nom | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/autoformat.nom b/tools/autoformat.nom index 7126608..de25292 100755 --- a/tools/autoformat.nom +++ b/tools/autoformat.nom @@ -1,6 +1,17 @@ -#!/usr/bin/env nomsu -V2.3.4.3 +#!/usr/bin/env nomsu -V2.4.4.3 use "core" use "lib/os.nom" -for %path in (=lua "arg"): +%args = (command line args) +%inplace = (no) +if (%args.1 is "-i"): + %inplace = (yes) + remove index 1 from %args + +for %path in %args: for file %filename in %path: - say ((parse (read file %filename) from %filename) as nomsu) \ No newline at end of file + %formatted = ".." + #!/usr/bin/env nomsu -V\(Nomsu version) + \((parse (read file %filename) from %filename) as nomsu) + + if %inplace: write %formatted to file %filename + ..else: say %formatted \ No newline at end of file -- cgit v1.2.3