Skip to content

Commit 42a0719

Browse files
author
Michael Klishin
committed
Use fn clause matching
This does not perform downcasing and thus makes BASIC refugees unhappy, but @yrashk suggests we can live with that.
1 parent 4527c1e commit 42a0719

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lib/mix/lib/mix/cli.ex

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ defmodule Mix.CLI do
6767
run_task "help", []
6868
end
6969

70-
defp help_argument?(s) do
71-
if s do
72-
String.downcase(s) in ["--help", "-h", "-help"]
73-
else
74-
false
75-
end
76-
end
77-
78-
defp help?(args) do
79-
help_argument?(Enum.first(args))
80-
end
70+
defp help?([first_arg|_]) when first_arg in ["--help", "-h", "-help"], do: true
71+
defp help?(_), do: false
8172
end

0 commit comments

Comments
 (0)