Skip to content

Commit

Permalink
#363 fix format command-line utility
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Baumgold committed Feb 10, 2021
1 parent 58ee13c commit acf788c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/format.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Flags:
-h, --help
Print this message.
-o, --overwrite
Writes the formatted source to a new file where the original
filename is suffixed with _fmt, i.e. `filename_fmt.jl`.
-c, --check
Check if the files are correctly formatted. Return code 0 means nothing
would change. Return code 1 means some files would be reformatted.
--always_for_in
Always replaces `=` with `in` for `for` loops.
Expand Down Expand Up @@ -65,7 +65,7 @@ function parse_opts!(args::Vector{String})
opt = :verbose
elseif arg == "-h" || arg == "--help"
opt = :help
elseif arg == "-o" || arg == "--overwrite"
elseif arg == "-c" || arg == "--check"
opt = :overwrite
elseif arg == "--always_for_in"
opt = :always_for_in
Expand Down Expand Up @@ -104,4 +104,4 @@ if isempty(ARGS) || haskey(opts, :help)
write(stdout, help)
exit(0)
end
format(ARGS; opts...)
exit(format(ARGS; opts...) ? 0 : 1)

0 comments on commit acf788c

Please sign in to comment.