Skip to content

Commit

Permalink
Remove deprecated --arm_tools_dir argument
Browse files Browse the repository at this point in the history
It's been deprecated for a while. Remove it.

Few other miscellaneous changes around arguments:

- print default values for args
- permit both `_` and `-` delimited flags; `-` are pretty standard and
  it's simple to support both (although makes the help ugly)
  • Loading branch information
noahp committed Mar 2, 2023
1 parent b2f1743 commit fdbc845
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions puncover/puncover.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,30 @@ def open_browser(host, port):


def main():
gcc_tools_base = os.path.join(find_arm_tools_location(), 'bin/arm-none-eabi-')

parser = argparse.ArgumentParser(
description="Analyses C/C++ build output for code size, static variables, and stack usage.")
parser.add_argument('--arm_tools_dir', dest='arm_tools_dir', default=find_arm_tools_location(),
help='DEPRECATED! location of your arm tools.')
parser.add_argument('--gcc_tools_base', dest='gcc_tools_base',
description="Analyses C/C++ build output for code size, static variables, and stack usage.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument('--gcc-tools-base', '--gcc_tools_base', default=gcc_tools_base,
help='filename prefix for your gcc tools, e.g. ~/arm-cs-tools/bin/arm-none-eabi-')
parser.add_argument('--elf_file', dest="elf_file", required=True,
parser.add_argument('--elf_file', '--elf-file', required=True,
help='location of an ELF file')
parser.add_argument('--src_root', dest='src_root',
parser.add_argument('--src_root', '--src-root',
help='location of your sources')
parser.add_argument('--build_dir', dest='build_dir',
parser.add_argument('--build_dir', '--build-dir',
help='location of your build output')
parser.add_argument('--debug', action='store_true',
help='enable Flask debugger')
parser.add_argument('--port', dest='port', default=default_port, type=int,
help='port the HTTP server runs on')
parser.add_argument('--host', dest='host', default='127.0.0.1',
parser.add_argument('--host', default='127.0.0.1',
help='host IP the HTTP server runs on')
parser.add_argument('--no-open-browser', action='store_true',
help="don't automatically open a browser window")
args = parser.parse_args()

if not args.gcc_tools_base:
if args.arm_tools_dir:
print('DEPRECATED: argument --arm_tools_dir will be removed, use --gcc_tools_base instead.')
args.gcc_tools_base = os.path.join(args.arm_tools_dir, 'bin/arm-none-eabi-')

builder = create_builder(args.gcc_tools_base, elf_file=args.elf_file,
src_root=args.src_root, su_dir=args.build_dir)
builder.build_if_needed()
Expand Down

0 comments on commit fdbc845

Please sign in to comment.