Skip to content

build.sh swallows -D switch if a positional argument follows it #1341

@DSMitten

Description

@DSMitten

Repro (on Linux):

./build.sh -DBUILD_UNIT_TESTS=NO -DBUILD_FUNC_TESTS=NO noroot

The result is that the build script parses noroot, then executes a shift commands which causes the first argument (-DBUILD_UNIT_TESTS=NO) to not be evaluated by getopt

Positional arguments should probably only be valid if they precede the switches, and any arguments trailing the switches should probably result in an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions