Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access argv / command line options in Dart?

And does Dart have a getopt library?

like image 254
mcandre Avatar asked Feb 14 '12 15:02

mcandre


1 Answers

Using Options is no longer an option, use:

void main(List<String> args) {
   print(args);
}

To get executable, use Platform.executable (Platform comes from dart:io)

For parsing arguments passed to main, use this cool package

like image 155
Tomas Kulich Avatar answered Sep 21 '22 09:09

Tomas Kulich