Skip to content

Commit

Permalink
mpy-cross: Allow specifying stdin as input without --.
Browse files Browse the repository at this point in the history
This way, a bare `-` is never interpreted as an option, even before
`--`. Filenames starting with `-` still need to be put after `--`.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
  • Loading branch information
arbrauns authored and dpgeorge committed Jul 24, 2023
1 parent 3164749 commit 1437485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mpy-cross/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ MP_NOINLINE int main_(int argc, char **argv) {

// parse main options
for (int a = 1; a < argc; a++) {
if (option_parsing_active && argv[a][0] == '-') {
if (option_parsing_active && argv[a][0] == '-' && argv[a][1] != '\0') {
if (strcmp(argv[a], "-X") == 0) {
a += 1;
} else if (strcmp(argv[a], "--version") == 0) {
Expand Down

0 comments on commit 1437485

Please sign in to comment.