Skip to content

Commit a89ad7a

Browse files
committed
Minor improvements
Signed-off-by: Derek G Foster <[email protected]>
1 parent 2d83bfd commit a89ad7a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

scripts/p4cpconfig.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2023 Intel Corporation.
44
# SPDX-License-Identifier: Apache-2.0
55
#
6-
# Generates P4 Control Plane configuration files.
6+
# Generates P4 Control Plane build configuration files.
77
#
88

99
import argparse
@@ -411,12 +411,12 @@ def resolve_path(name, value, check_path=True):
411411
return realpath
412412

413413
#-----------------------------------------------------------------------
414-
# parse_args() - Parses the command-line parameters.
414+
# create_parser() - Creates the command-line parser.
415415
#-----------------------------------------------------------------------
416-
def parse_args():
416+
def create_parser():
417417
parser = argparse.ArgumentParser(
418-
prog='setup-util.py',
419-
description='Generates build configuration file(s) for a target.')
418+
prog='p4cpconfig',
419+
description='Generates build configuration file for a target.')
420420

421421
parser.add_argument('--format', '-f', type=str,
422422
default='cmake',
@@ -464,9 +464,10 @@ def parse_args():
464464
options.add_argument('--with-ovs', type=str2bool,
465465
help='include open vswitch')
466466

467-
return parser.parse_args()
467+
return parser
468468

469469
def str2bool(v):
470+
"""Converts a string to a Boolean value."""
470471
if isinstance(v, bool):
471472
return v
472473
if v.lower() in ('yes', 'on', 'true', 't', 'y', '1'):
@@ -482,7 +483,8 @@ def str2bool(v):
482483
if __name__ == '__main__':
483484
logging.basicConfig(level=logging.INFO)
484485

485-
args = parse_args()
486+
parser = create_parser()
487+
args = parser.parse_args()
486488
process_args(args)
487489

488490
if errcount != 0:

0 commit comments

Comments
 (0)