Skip to content

[desktop] Pass command line arguments through to Dart's 'main' #32986

@ghost

Description

Use case

I am trying to build an image viewer for Linux desktop and I need to provide command line interface for the the application like most Linux applications

Proposal

Currently any arguments passed to the built binary on desktop when executed from terminal just ignores command line arguments. The arguments passed to binary should be available inside main() as shown below

void main(List<String> args) {
  print('Arguments');
  print(args.toString());
  runApp(new MyApp());
}

The array printed should have "hi"

screenshot

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions