Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pub global run should expose invocation metadata #22098

Closed
DartBot opened this issue Jan 16, 2015 · 4 comments
Closed

pub global run should expose invocation metadata #22098

DartBot opened this issue Jan 16, 2015 · 4 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jan 16, 2015

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"

@lrhn
Copy link
Member

lrhn commented Jan 19, 2015

Added Area-Pub, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jan 19, 2015

This comment was originally written by @seaneagan


I just realized this is a similar request to issue #19580 that I previously posted.

However, the use case is different, and now that the pub [global] run stuff has settled down, I believe the problem and solution and pretty clear.

Also, it needs to handle pub run foo ... as well, so probably just PUB_RUN_INVOCATION, which in the case of pub run foo ... would be set to pub run foo

@DartBot
Copy link
Author

DartBot commented Apr 15, 2015

This comment was originally written by @seaneagan


Yet another use case:

seaneagan/unscripted#21 (comment)

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#1234.

@DartBot DartBot closed this as completed Jun 5, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants