Getting the command line arguments in Dart (vm)

Another hidden gem in the Dart library today, can you tell I am trying to write a command line thingy? Reading the command line options is really easy.
void main() {
  Options opts = new Options();
  for (String arg in opts.arguments) {
    print(arg);
  }
}
Let us play:
$ dart opts.dart a
a
$ dart opts.dart a b c d
a
b
c
d
Nothing to add, I think, except check the source.

Comments on Google+.

Popular posts from this blog

PyGTK, Py2exe, and Inno setup for single-file Windows installers

ESP-IDF for Arduino Users, Tutorials Part 2: Delay

How to install IronPython2 with Mono on Ubuntu