Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional argument brackets were appearing in the usage message for mandatory arguments. #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/getopt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,11 @@ usage_cmd_line_option({Name, Short, Long, ArgSpec, _Help}) when is_atom(ArgSpec)
%% For options with no default argument.
if
%% For options with short form and argument.
Short =/= undefined -> [$[, $-, Short, $\s, $<, atom_to_list(Name), $>, $]];
Short =/= undefined -> [$-, Short, $\s, $<, atom_to_list(Name), $>];
%% For options with only long form and argument.
Long =/= undefined -> [$[, $-, $-, Long, $\s, $<, atom_to_list(Name), $>, $]];
Long =/= undefined -> [$-, $-, Long, $\s, $<, atom_to_list(Name), $>];
%% For options with neither short nor long form and argument.
true -> [$[, $<, atom_to_list(Name), $>, $]]
true -> [$<, atom_to_list(Name), $>]
end;
usage_cmd_line_option({Name, Short, Long, ArgSpec, _Help}) when is_tuple(ArgSpec) ->
%% For options with default argument.
Expand Down