'Argparse not working with bazel - unrecognized option

I have the following argparse setup in my script

parser = argparse.ArgumentParser(
    description="Tool for converting logs into our ML dataset format")
parser.add_argument('toml_path', metavar='toml-path', type=str,
                    help="path to the log format")

But when i run the script via bazel

bazel run //src:script -- --toml_path="path.toml"

It fails with error: the following arguments are required: toml-path

What am i doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source