Description
Problem
Currently on Windows, external cargo subcommands must have the .exe
extension for cargo to recognize them.
However, .exe
files are not the only executable extensions as you already know.
Proposed Solution
What many don't know is, there's a standardized environment variable Windows uses to determine if files can be executed from $PATH
, which is also pre-populated by Windows: $PATHEXT
.
The contents of $PATHEXT
might look like this:
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JSE;.WSF;.WSH;.MSC;.CPL
The user is free to extend this value by adding custom extensions, and the "interpreter" is likewise configurable through some built-in cmd.exe commands or the Windows registry.
On Linux or MacOSX file extensions play no role so the user can write their cargo extensions in a bash script with a shebang and set the executable bit for cargo to recognize it (assuming the file is named cargo-*
and available under $PATH
).
Similar can be accomplished by respecting the value of $PATHEXT
on Windows, or, not specifying *.exe
since programs with an extension contained in $PATHEXT
don't require the extension to be specified.
Notes
No response