Skip to content

Commit

Permalink
cli: simplify the parsing of configuration settings
Browse files Browse the repository at this point in the history
  • Loading branch information
layday authored and FFY00 committed Jan 15, 2021
1 parent d247d1f commit 472dcca
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/build/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,7 @@ def main(cli_args, prog=None): # type: (List[str], Optional[str]) -> None

if args.config_setting:
for arg in args.config_setting:
if sys.version_info >= (3,):
data = arg.split('=', maxsplit=1)
else:
split_data = arg.split('=')
data = [
split_data[0],
'='.join(split_data[1:]),
]
setting = data[0]
value = data[1] if len(data) >= 2 else ''

setting, _, value = arg.partition('=')
if setting not in config_settings:
config_settings[setting] = value
else:
Expand Down

0 comments on commit 472dcca

Please sign in to comment.