This Blog continues on http://aliafshar.github.io/blog

Saturday, December 10, 2011

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+.