Skip to content

Commit

Permalink
fix typos in variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
savonarola committed Jul 6, 2023
1 parent 6d840b9 commit 411646b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/optimus/builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ defmodule Optimus.Builder do
with {:ok, arg} <- module.new(arg_spec), do: build_specs_(module, other, [arg | parsed])
end

defp build_subcommands(nil, _gloal_props), do: {:ok, []}
defp build_subcommands(nil, _global_props), do: {:ok, []}

defp build_subcommands(subcommands, gloal_props) do
defp build_subcommands(subcommands, global_props) do
if Keyword.keyword?(subcommands) do
build_subcommands_(subcommands, gloal_props, [])
build_subcommands_(subcommands, global_props, [])
else
{:error, "subcommand specs are expected to be a Keyword list"}
end
end

defp build_subcommands_([], _gloal_props, parsed), do: {:ok, Enum.reverse(parsed)}
defp build_subcommands_([], _global_props, parsed), do: {:ok, Enum.reverse(parsed)}

defp build_subcommands_([{subcommand_name, props} | other], global_props, parsed) do
case build_(props, global_props) do
Expand Down Expand Up @@ -179,7 +179,7 @@ defmodule Optimus.Builder do

defp merge_globals_into_subcommand(
subcommand,
%{flags: global_flags, options: global_options} = _gloal_props
%{flags: global_flags, options: global_options} = _global_props
) do
subcommand
|> Map.update(:flags, [], fn flags -> flags ++ global_flags end)
Expand Down

0 comments on commit 411646b

Please sign in to comment.