Skip to content

Options::parse() should complain about unsupported options and should print help #144

Closed

Description

@yurivict

This code:

int
main(int argc, char* argv[]) {
  Options opt("Testcase");
  opt.iterations(200);
  opt.parse(argc,argv);
  Script::run<Testcase,DFS,Options>(opt);
  return 0;
}

doesn't complain about bad arguments and doesn't print help.

It would be great if it would become a bit more user friendly.

Activity

  1. zayenz commented on Nov 16, 2026

    @zayenz
    Member

    Gecode 6.6.0 adds opt-in strict parsing: parse_strict() reports the first unrecognised argument, prints the help text and exits with failure. SizeOptions and InstanceOptions accept their size or instance as the only remaining argument. The examples use it, and parse() keeps its behaviour; strict parsing will become the default in a future major release. See https://github.com/Gecode/gecode/releases/tag/release-6.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions