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

args parser cannot accept option arguments starting with a hyphen #21958

Closed
DartBot opened this issue Dec 24, 2014 · 2 comments
Closed

args parser cannot accept option arguments starting with a hyphen #21958

DartBot opened this issue Dec 24, 2014 · 2 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.

Comments

@DartBot
Copy link

DartBot commented Dec 24, 2014

This issue was originally filed by @hoylen


What steps will reproduce the problem?

  1. Run the program below with arguments "-t -32"

dart bin/test-args-hyphen.dart -t -32

What is the expected output? What do you see instead?

Expected: Temperature is: -32

Got: FormatException: Missing argument for "temperature".

It treats the option argument as another option instead of the argument to the "-t" option.

What version of the product are you using?

1.8.3

On what operating system?

linux_x64

Please provide any additional information below.

// Test program

import 'package:args/args.dart';

void main(List<String> arguments) {

  var parser = new ArgParser(allowTrailingOptions: true);
  parser.addOption('temperature', abbr: 't', help: 'degrees');

  var results = parser.parse(arguments);

  print("Temperature is: ${results['temperature']}");;
}

//EOF

@lrhn
Copy link
Member

lrhn commented Dec 27, 2014

Added Pkg-Args, Area-Pkg, Triaged labels.

@DartBot DartBot added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels Dec 27, 2014
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/args#36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.
Projects
None yet
Development

No branches or pull requests

3 participants