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 #1234

Closed
DartBot opened this issue Jun 5, 2015 · 4 comments
Closed

pub global run should expose invocation metadata #1234

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

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#22098


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"

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/4865287?v=3" align="left" width="48" height="48"hspace="10"> Comment by lrhn


Added Area-Pub, Triaged labels.

@DartBot DartBot added the type-enhancement A request for a change that isn't a bug label Jun 5, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment by seaneagan


I just realized this is a similar request to issue #1020 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 Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment by seaneagan


Yet another use case:

seaneagan/unscripted#21 (comment)

@sigurdm
Copy link
Contributor

sigurdm commented Mar 7, 2024

We don't see the big usefulness of this.

Closing as wontfix.

Please open a new issue with a described use case if this is still important.

@sigurdm sigurdm closed this as completed Mar 7, 2024
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

2 participants