Skip to content

pub global run should expose invocation metadata #22098

Closed
@DartBot

Description

@DartBot

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions