Title add mechanism for global flags set on the command line
Priority feature Status unread
Superseder Nosy List jendrik, malte, silvan
Assigned To Keywords
Optional summary

Created on 2016-01-08.16:35:08 by malte, last changed by silvan.

msg5051 (view) Author: malte Date: 2016-01-08.16:35:08
We want to add a simple plug-in mechanism for boolean global flags defined on
the command line.

The developer could write

    FlagPlugin peter("strunkbolzen");

on the global level to define a plugin (similar to "normal" plugins and

In their code, they can then use

    if (peter) {
        // debug stuff, special log output

to test if the flag has been set by the user. The user would set the flag by
saying "--flag strunkbolzen" on the command line.

This is mainly meant for simple debugging while working on the code. An
alternative is to add a new option to a plugin object. For example, if "peter"
is used for debugging the merge-and-shrink heuristic, then one could alternative
give the merge-and-shrink heuristic object a new option "debug" or whatever. But
this is much more work: it requires modifying the parser for merge-and-shrink
heuristic, adding the object to the class, setting it in the constructor, and
passing it around to users that don't have direct access to the merge-and-shrink
heuristic object. Also, it requires changing the option strings when calling the
planner in a more complex way than just appending "--flag strunkbolzen".

Also, if we want, we can later configure the state of the flag from other
sources (like environment variable DOWNWARD_FLAG_STRUNKBOLZEN) in situations
where it's not so easy to modify the option string, e.g. because it comes from a
script or alias. But this last bit is just an idea for future extension.
Date User Action Args
2016-01-08 16:53:42silvansetnosy: + silvan
2016-01-08 16:41:03jendriksetnosy: + jendrik
2016-01-08 16:35:08maltecreate