Closed
Description
This issue was originally filed by @seaneagan
If a script has a renamed executable like so:
executables:
format: dartformat
Then it can be invoked in two different ways:
pub global run dart_style:format
dartformat
It would be useful if such apps can detect which way they were invoked to display appropriate help text, error messages, etc.
It could be exposed via either of:
* Platform.environment['PUB_GLOBAL_RUN_INVOCATION']
- const String.fromEnvironment('PUB_GLOBAL_RUN_INVOCATION')
The binstubs would set this before calling pub global run
, and then `pub global run would initialize it using the invocation it received if it was not already set by the binstub.
So it's value would be e.g. "dartformat" or "pub global run dart_style:format"