Skip to content

Commit

Permalink
Fix bug in handling of user-defined options
Browse files Browse the repository at this point in the history
_parse_compiler_args was configured to ignore the first argument, assuming that
it would be the name of the compiler binary.

Everything worked properly for options lists captured from real commands, but
the first argument was being incorrectly stripped from generated from
user-provided options strings.

Signed-off-by: John Pennycook <[email protected]>
  • Loading branch information
Pennycook committed Jan 17, 2025
1 parent 47ddc89 commit 8eefddc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codebasin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _parse_compiler_args(argv: list[str]):
action="append",
default=[],
)
args, _ = parser.parse_known_args(argv[1:])
args, _ = parser.parse_known_args(argv)
return args


Expand Down Expand Up @@ -294,7 +294,7 @@ def load_database(dbpath, rootdir):
argv = command.arguments

# Parse common command-line arguments.
args = _parse_compiler_args(argv)
args = _parse_compiler_args(argv[1:])
defines = args.defines
include_paths = args.include_paths
include_files = args.include_files
Expand Down

0 comments on commit 8eefddc

Please sign in to comment.