Skip to content

Commit 15bf099

Browse files
authored
[emsymbolizer] Restrict choices of source (#18272)
Currently `-s`/`--source` option can take any string, but only `dwarf` and `sourcemap` are meaningful values for that. This restricts the choices to those two values in `argparse`. This also has a benefit of showing the possible values in the help message, so you can know what to add after `-s` without checking the source code.
1 parent 02f26d4 commit 15bf099

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

emsymbolizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ def main(args):
230230

231231
def get_args():
232232
parser = argparse.ArgumentParser()
233-
parser.add_argument('-s', '--source', help='Force debug info source type',
234-
default=())
233+
parser.add_argument('-s', '--source', choices=['dwarf', 'sourcemap'],
234+
help='Force debug info source type', default=())
235235
parser.add_argument('-f', '--file', action='store',
236236
help='Force debug info source file')
237237
parser.add_argument('-t', '--addrtype', choices=['code', 'file'],

0 commit comments

Comments
 (0)