Skip to content

Default will never be printed for flag_bool with def=false #14

@ej-uses-git

Description

@ej-uses-git

I was copying over the library and renaming some things and came acorss the following lines in flag.h:

if (flag->def.as_bool) {
    fprintf(stream, "        Default: %s\n", flag->def.as_bool ? "true" : "false");
}

As you can see, the ternary operator there will always result in "true", since we just checked that it's non-zero in the if above it...

Maybe instead we can just always print the default for booleans?

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