直接上代码:
import argparse
options = {}
def parserDeal():
parser = argparse.ArgumentParser(description='Display User info by FiledepotPath and Rows')
parser.add_argument('-F',
metavar="",
action="store",
type=str,
dest="depotPath",
help='File depot Path(s)')
parser.add_argument('-R',
metavar="",
action="store",
type=int,
dest="Rows",
help='code line Numbers,be used to Get UserInfo(s)')
global options
options = parser.parse_args()
https://www.cnblogs.com/happystudyeveryday/p/16590921.html
比较需要关注的点有
group.add_argument("-d", "--down")
required=True
default='hello'
type=
argparse --- 命令行选项、参数和子命令解析器 — Python 3.10.2 文档
argparse库的作用及其用法详解_Merlin_CAE的博客-CSDN博客