From cdcb3f56e8d5b5f51cd12721feaf8679953547b1 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 23 Dec 2024 08:27:16 +0100 Subject: [PATCH] utils/get-developers: don't offload parse_args() Offloading parser.parse_args() to a helper function does not bring much, if at all; it even is restrictive: indeed, we can't use parser.error() to report errors and thus have to resort to a canned print+return sequence... Signed-off-by: Yann E. MORIN Signed-off-by: Julien Olivain --- utils/get-developers | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/utils/get-developers b/utils/get-developers index 9ab5c4503f..33980366d6 100755 --- a/utils/get-developers +++ b/utils/get-developers @@ -5,7 +5,7 @@ import getdeveloperlib import sys -def parse_args(): +def __main__(): parser = argparse.ArgumentParser() parser.add_argument('patches', metavar='P', type=argparse.FileType('r'), nargs='*', help='list of patches (use - to read patches from stdin)') @@ -23,11 +23,7 @@ def parse_args(): const=True, help='validate syntax of DEVELOPERS file') parser.add_argument('-d', dest='filename', action='store', default=None, help='override the default DEVELOPERS file (for debug)') - return parser.parse_args() - - -def __main__(): - args = parse_args() + args = parser.parse_args() # Check that only one action is given action = 0