Skip to content

Commit

Permalink
Ability to return the version of Python launcher running
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksis committed Jan 7, 2023
1 parent 72263f2 commit 79a281f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions PC/launcher2.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ typedef struct {
bool listPaths;
// if true, display help message before contiuning
bool help;
// if true, display Python Launcher version before contiuning
bool version;
// dynamically allocated buffers to free later
struct _SearchInfoBuffer *_buffer;
} SearchInfo;
Expand Down Expand Up @@ -647,6 +649,8 @@ parseCommandLine(SearchInfo *search)
search->help = true;
// Do not update restOfCmdLine so that we trigger the help
// message from whichever interpreter we select
} else if (STARTSWITH(L"V") || STARTSWITH(L"-version")) {
search->version = true;
}
}
}
Expand Down Expand Up @@ -2464,6 +2468,11 @@ process(int argc, wchar_t ** argv)
}
}

if (search.version) {
fwprintf(stdout, L"Python launcher for Windows %S\n", PY_VERSION);
fflush(stdout);
}

// Select best environment
// This is early so that we can show the default when listing, but all
// responses to any errors occur later.
Expand Down

0 comments on commit 79a281f

Please sign in to comment.