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

Knowing the name of the executing script #409

Closed
DartBot opened this issue Nov 10, 2011 · 4 comments
Closed

Knowing the name of the executing script #409

DartBot opened this issue Nov 10, 2011 · 4 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Nov 10, 2011

This issue was originally filed by ngeoffray@google.com


It would be nice to have access in Dart to the name of the executing script. For example, getting 'myscript.dart' from the command:

dart_bin myscript.dart 1 2 3

$ cat myscript.dart

main() {
  String scriptName = .... // api to get the name
  print('command invoked: dart_bin $scriptName ${Strings.join(new Options().argument)}');
}

The Options class does not provide it, it currently just provides [1, 2, 3].

@iposva-google
Copy link
Contributor

I'll extend the Options class with a script accessor. In the specification we called this the root library, but I am not sure that makes any sense in this context. I am open to suggestions of a better name though. Nicolas?


Added Accepted label.

@DartBot
Copy link
Author

DartBot commented Nov 10, 2011

This comment was originally written by ngeoffray@google.com


The name 'script' looks fine by me.

Another option would be to make it the first argument in the options array. Did you consider it? I think that's what other mainstream languages do.

@whesse
Copy link
Contributor

whesse commented Jan 12, 2012

Issue #1145 has been merged into this issue.

@whesse
Copy link
Contributor

whesse commented Jan 23, 2012

Fixed in r3485. Should the library be documented in CoreLib or in server-side? It is implemented in CoreLib, but only useful implementation is on server-side VM.


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants