diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-19 20:41:31 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-19 20:42:09 -0700 |
| commit | 47db74229deaf281ad02c8305c4e4d4c8dbd3d7d (patch) | |
| tree | fac39ef65240c3de58b68a4f59bb93f2d4e622c6 /tools/autoformat.nom | |
| parent | 0eff1c77f250e6839086f41af0c79bb3e2e8ea39 (diff) | |
Fixed some bugs in trailing_line_len() and refactored tree_to_nomsu into
separate inline/not-inline functions.
Diffstat (limited to 'tools/autoformat.nom')
| -rwxr-xr-x | tools/autoformat.nom | 17 |
1 files changed, 14 insertions, 3 deletions
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 |
