Skip to content

Commit

Permalink
Don't interpret a literal "-" as an option argument on command line
Browse files Browse the repository at this point in the history
This allows the following command to work properly:

git-crypt export-key -

Previously, you had to run this command, because - was being interpreted
as an option argument:

git-crypt export-key -- -
  • Loading branch information
AGWA committed Apr 28, 2020
1 parent 89bcafa commit 7c129cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int parse_options (const Options_list& options, int argc, const char** argv)
{
int argi = 0;

while (argi < argc && argv[argi][0] == '-') {
while (argi < argc && argv[argi][0] == '-' && argv[argi][1] != '\0') {
if (std::strcmp(argv[argi], "--") == 0) {
++argi;
break;
Expand Down

0 comments on commit 7c129cd

Please sign in to comment.