def parseCommandLineArgs():
"""
As implied by the name, this will parse the command line arguments so we can use them.
:return: A parsed object as provided by argparse.parse_args()
"""
parser = argparse.ArgumentParser(prog="Debugger.py",
description="Capua On Chip Debugger Version {}".format(__version__,),
epilog="This tool is provided as part of Spartacus learning environment under {} "
"licence. Feel free to distribute, modify, "
"contribute and learn!".format(__license__,))
parser.add_argument("-i", "--input",
required=True,
type=str,
help="Define the input file(s) to be used.")
parser.add_argument("-o", "--output",
required=False,
nargs=1,
type=str,
help="This is optional. If present, debugging session will be logged to specified file")
parser.add_argument("-a", "--address",
required=False,
nargs=1,
type=int,
default=None,
help="Define the address at which a binary should be loaded.")
parser.add_argument("-s", "--software",
required=False,
nargs=1,
type=bool,
default=False,
help="This is required if -s option was used on the linker. That will allow "
"binary to be loader at correct address specified inside the binary")
args = parser.parse_args()
return args
Debugger.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录