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 <yann.morin@orange.com> Signed-off-by: Julien Olivain <ju.o@free.fr> (cherry picked from commit cdcb3f56e8d5b5f51cd12721feaf8679953547b1) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
be585e15ed
commit
6c0f612efa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user