Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/abi_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ def check_for_abi_changes(self):
def run_main():
try:
parser = argparse.ArgumentParser(
description=__doc__
description=__doc__,
allow_abbrev=False
)
parser.add_argument(
"-v", "--verbose", action="store_true",
Expand Down
3 changes: 2 additions & 1 deletion scripts/assemble_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ def set_defaults(options):

def main():
"""Command line entry point."""
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(description=__doc__,
allow_abbrev=False)
parser.add_argument('--dir', '-d', metavar='DIR',
default='ChangeLog.d',
help='Directory to read entries from'
Expand Down
3 changes: 2 additions & 1 deletion scripts/code_size_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,8 @@ def get_comparision_results(self) -> None:
self.gen_code_size_comparison()

def main():
parser = argparse.ArgumentParser(description=(__doc__))
parser = argparse.ArgumentParser(description=(__doc__),
allow_abbrev=False)
group_required = parser.add_argument_group(
'required arguments',
'required arguments to parse for running ' + os.path.basename(__file__))
Expand Down
2 changes: 1 addition & 1 deletion scripts/code_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def main() -> int:
print("Note: The only supported version is " +
UNCRUSTIFY_SUPPORTED_VERSION)

parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('-f', '--fix', action='store_true',
help=('modify source files to fix the code style '
'(default: print diff, do not modify files)'))
Expand Down
5 changes: 3 additions & 2 deletions scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,9 @@ def filename(self, name=None):
def main():
"""Command line mbedtls_config.h manipulation tool."""
parser = argparse.ArgumentParser(description="""
Mbed TLS configuration file manipulation tool.
""")
Mbed TLS configuration file manipulation tool.
""",
allow_abbrev=False)
parser.add_argument('--file', '-f',
help="""File to read (and modify if requested).
Default: {}.
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_driver_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def main() -> int:
"""
def_arg_project_root = build_tree.guess_project_root()

parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('--project-root', default=def_arg_project_root,
help='root directory of repo source code')
parser.add_argument('--template-dir',
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_ssl_debug_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def main():
"""
Command line entry
"""
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('--mbedtls-root', nargs='?', default=None,
help='root directory of mbedtls source code')
parser.add_argument('output_directory', nargs='?',
Expand Down
3 changes: 2 additions & 1 deletion scripts/min_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def install(

def main() -> None:
"""Command line entry point."""
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(description=__doc__,
allow_abbrev=False)
parser.add_argument('--no-act', '-n',
action='store_true',
help="Don't act, just print what will be done")
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/analyze_outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ def main():
main_results = Results()

try:
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(description=__doc__,
allow_abbrev=False)
parser.add_argument('outcomes', metavar='OUTCOMES.CSV',
help='Outcome file to analyze')
parser.add_argument('specified_tasks', default='all', nargs='?',
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/audit-validity-dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ def main():
"""
Perform argument parsing.
"""
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(description=__doc__,
allow_abbrev=False)

parser.add_argument('-a', '--all',
action='store_true',
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/check_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ def output_issues(self):


def run_main():
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(description=__doc__,
allow_abbrev=False)
parser.add_argument(
"-l", "--log_file", type=str, help="path to optional output log",
)
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/check_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ def main():
"This script confirms that the naming of all symbols and identifiers "
"in Mbed TLS are consistent with the house style and are also "
"self-consistent.\n\n"
"Expected to be run from the Mbed TLS root directory.")
"Expected to be run from the Mbed TLS root directory."),
allow_abbrev=False
)
parser.add_argument(
"-v", "--verbose",
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/check_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def process_test_case(self, per_file_state,
seen[description] = line_number

def main():
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(description=__doc__,
allow_abbrev=False)
parser.add_argument('--list-all',
action='store_true',
help='List all test cases, without doing checks')
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ def main():
"Example usage:\n"
r"./tests/scripts/depends.py \!MBEDTLS_SHA1_C MBEDTLS_SHA256_C""\n"
"./tests/scripts/depends.py MBEDTLS_AES_C hashes\n"
"./tests/scripts/depends.py cipher_id cipher_chaining\n")
"./tests/scripts/depends.py cipher_id cipher_chaining\n",
allow_abbrev=False)
parser.add_argument('--color', metavar='WHEN',
help='Colorize the output (always/auto/never)',
choices=['always', 'auto', 'never'], default='auto')
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/generate_server9_bad_saltlen.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def build_argparser(parser):


def main():
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(allow_abbrev=False)
build_argparser(parser)
args = parser.parse_args()

Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/generate_tls13_compat_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def main():
"""
Main function of this program
"""
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(allow_abbrev=False)

parser.add_argument('-o', '--output', nargs='?',
default=None, help='Output file path if `-a` was set')
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/list_internal_identifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def main():
description=(
"This script writes a list of parsed identifiers in internal "
"headers to \"identifiers\". This is useful for generating a list "
"of names to exclude from API/ABI compatibility checking. "))
"of names to exclude from API/ABI compatibility checking. "),
allow_abbrev=False)

parser.parse_args()

Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/psa_collect_statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def collect_status_logs(options):
return data

def main():
parser = argparse.ArgumentParser(description=globals()['__doc__'])
parser = argparse.ArgumentParser(description=globals()['__doc__'],
allow_abbrev=False)
parser.add_argument('--clean-after',
action='store_true',
help='Run "make clean" after rebuilding')
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/run_demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def run_all_demos(quiet=False):
return run_demos(all_demos, quiet=quiet)

def main():
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(description=__doc__,
allow_abbrev=False)
parser.add_argument('--quiet', '-q',
action='store_true',
help="suppress the output of demos")
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/test_config_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def run_all(options):
def main():
"""Command line entry point."""
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
formatter_class=argparse.RawDescriptionHelpFormatter,
allow_abbrev=False)
parser.add_argument('-d', metavar='DIR',
dest='output_directory', required=True,
help="""Output directory.""")
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/test_psa_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def main(library_build_dir: str):
BUILD_DIR = 'out_of_source_build'

# pylint: disable=invalid-name
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('--build-dir', nargs=1,
help='path to Mbed TLS / TF-PSA-Crypto build directory')
args = parser.parse_args()
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/test_psa_constant_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def report(self, out: typing_util.Writable) -> None:
TEST_SUITES = ['tf-psa-crypto/tests/suites/test_suite_psa_crypto_metadata.data']

def main():
parser = argparse.ArgumentParser(description=globals()['__doc__'])
parser = argparse.ArgumentParser(description=globals()['__doc__'],
allow_abbrev=False)
parser.add_argument('--include', '-I',
action='append', default=['tf-psa-crypto/include',
'tf-psa-crypto/drivers/builtin/include',
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/translate_ciphers.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def main(target, names):
print(format_ciphersuite_names(target, names))

if __name__ == "__main__":
PARSER = argparse.ArgumentParser()
PARSER = argparse.ArgumentParser(allow_abbrev=False)
PARSER.add_argument('target', metavar='TARGET', choices=['o', 'g', 'm'])
PARSER.add_argument('names', metavar='NAMES', nargs='+')
ARGS = PARSER.parse_args()
Expand Down