- Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathargument_parser.py
25 lines (15 loc) · 815 Bytes
/
argument_parser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
fromargparseimportArgumentParserasArgParser
from ._versionimportversion
classArgumentParser(ArgParser):
""" An argument parser for all sip command line tools. """
def__init__(self, description, build_tool=False, **kwargs):
""" Initialise the parser. """
super().__init__(description=description, **kwargs)
self.add_argument('-V', '--version', action='version', version=version)
# This option is handled by the bootstrap process and is only here to
# contribute to the help.
ifbuild_tool:
self.add_argument('--deprecations-are-errors', action='store_true',
help="using deprecated features is an error")