Skip to content

Commit ec70444

Browse files
nordicjmstephanosio
authored andcommitted
treewide: Disable automatic argparse argument shortening
Disables allowing the python argparse library from automatically shortening command line arguments, this prevents issues whereby a new command is added and code that wrongly uses the shortened command of an existing argument which is the same as the new command being added will silently change script behaviour. Signed-off-by: Jamie McCrae <[email protected]>
1 parent d428c8c commit ec70444

File tree

85 files changed

+104
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+104
-97
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ execute_process(
611611
${ZEPHYR_BASE}/scripts/build/subfolder_list.py
612612
--directory ${ZEPHYR_BASE}/include # Walk this directory
613613
--out-file ${syscalls_subdirs_txt} # Write file with discovered folder
614-
--trigger ${syscalls_subdirs_trigger} # Trigger file that is used for json generation
614+
--trigger-file ${syscalls_subdirs_trigger} # Trigger file that is used for json generation
615615
${syscalls_links} # If defined, create symlinks for dependencies
616616
)
617617
file(STRINGS ${syscalls_subdirs_txt} PARSE_SYSCALLS_PATHS_DEPENDS ENCODING UTF-8)
@@ -644,7 +644,7 @@ else()
644644
${ZEPHYR_BASE}/scripts/build/subfolder_list.py
645645
--directory ${ZEPHYR_BASE}/include # Walk this directory
646646
--out-file ${syscalls_subdirs_txt} # Write file with discovered folder
647-
--trigger ${syscalls_subdirs_trigger} # Trigger file that is used for json generation
647+
--trigger-file ${syscalls_subdirs_trigger} # Trigger file that is used for json generation
648648
${syscalls_links} # If defined, create symlinks for dependencies
649649
DEPENDS ${PARSE_SYSCALLS_PATHS_DEPENDS}
650650
)
@@ -740,7 +740,7 @@ add_custom_command(OUTPUT include/generated/syscall_dispatch.c ${syscall_list_h}
740740
)
741741

742742
# This is passed into all calls to the gen_kobject_list.py script.
743-
set(gen_kobject_list_include_args --include ${struct_tags_json})
743+
set(gen_kobject_list_include_args --include-subsystem-list ${struct_tags_json})
744744

745745
set(DRV_VALIDATION ${PROJECT_BINARY_DIR}/include/generated/driver-validation.h)
746746
add_custom_command(

arch/x86/gen_gdt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def parse_args():
158158
global args
159159
parser = argparse.ArgumentParser(
160160
description=__doc__,
161-
formatter_class=argparse.RawDescriptionHelpFormatter)
161+
formatter_class=argparse.RawDescriptionHelpFormatter, allow_abbrev=False)
162162

163163
parser.add_argument("-k", "--kernel", required=True,
164164
help="Zephyr kernel image")

arch/x86/gen_idt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def parse_args():
251251
global args
252252
parser = argparse.ArgumentParser(
253253
description=__doc__,
254-
formatter_class=argparse.RawDescriptionHelpFormatter)
254+
formatter_class=argparse.RawDescriptionHelpFormatter, allow_abbrev=False)
255255

256256
parser.add_argument("-m", "--vector-map", required=True,
257257
help="Output file mapping IRQ lines to IDT vectors")

arch/x86/gen_mmu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def parse_args():
599599

600600
parser = argparse.ArgumentParser(
601601
description=__doc__,
602-
formatter_class=argparse.RawDescriptionHelpFormatter)
602+
formatter_class=argparse.RawDescriptionHelpFormatter, allow_abbrev=False)
603603

604604
parser.add_argument("-k", "--kernel", required=True,
605605
help="path to prebuilt kernel ELF binary")

arch/x86/zefi/zefi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def build_elf(elf_file, include_dirs):
142142
def parse_args():
143143
parser = argparse.ArgumentParser(
144144
description=__doc__,
145-
formatter_class=argparse.RawDescriptionHelpFormatter)
145+
formatter_class=argparse.RawDescriptionHelpFormatter, allow_abbrev=False)
146146

147147
parser.add_argument("-c", "--compiler", required=True, help="Compiler to be used")
148148
parser.add_argument("-o", "--objcopy", required=True, help="objcopy to be used")

doc/_scripts/gen_devicetree_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def main():
172172
def parse_args():
173173
# Parse command line arguments from sys.argv.
174174

175-
parser = argparse.ArgumentParser()
175+
parser = argparse.ArgumentParser(allow_abbrev=False)
176176
parser.add_argument('-v', '--verbose', default=0, action='count',
177177
help='increase verbosity; may be given multiple times')
178178
parser.add_argument('--vendor-prefixes', required=True,

samples/modules/tflite-micro/magic_wand/train/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def train_net(
176176

177177

178178
if __name__ == "__main__":
179-
parser = argparse.ArgumentParser()
179+
parser = argparse.ArgumentParser(allow_abbrev=False)
180180
parser.add_argument("--model", "-m")
181181
parser.add_argument("--person", "-p")
182182
args = parser.parse_args()

samples/net/cloud/google_iot_mqtt/src/private_info/create_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def parse_args():
1212
global args
1313

1414
parser = argparse.ArgumentParser(description=__doc__,
15-
formatter_class=argparse.RawDescriptionHelpFormatter)
15+
formatter_class=argparse.RawDescriptionHelpFormatter, allow_abbrev=False)
1616

1717
parser.add_argument(
1818
"-d", "--device", required=True,

samples/subsys/zbus/remote_mock/remote_mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
]"""
1515

1616
channels = json.loads(j)
17-
parser = argparse.ArgumentParser(description='Read zbus events via serial.')
17+
parser = argparse.ArgumentParser(description='Read zbus events via serial.', allow_abbrev=False)
1818
parser.add_argument("port", type=str, help='The tty or COM port to be used')
1919

2020
args = parser.parse_args()

samples/subsys/zbus/uart_bridge/decoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
]
1515
"""
1616

17-
parser = argparse.ArgumentParser(description='Read zbus events via serial.')
17+
parser = argparse.ArgumentParser(description='Read zbus events via serial.', allow_abbrev=False)
1818
parser.add_argument("port", type=str, help='The tty or COM port to be used')
1919

2020
args = parser.parse_args()

0 commit comments

Comments
 (0)