Skip to content

Commit

Permalink
Improve invalid cases of cli arguments with guards
Browse files Browse the repository at this point in the history
  • Loading branch information
nappex committed Nov 30, 2024
1 parent bbe3e0b commit d460b29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cli.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ defmodule Onigumo.CLI do
module.main(working_dir)
else
:error -> usage_message()
{_, _ , [_ | _]} -> usage_message()
{_, _, invalid_switches} when length(invalid_switches) -> usage_message()
{_, argv, _} when length(argv) != 1 -> usage_message()
_ -> usage_message()
end
end
Expand Down

0 comments on commit d460b29

Please sign in to comment.