def create_optional_arguments(parser):
""" Given a parser, create optional arguments."""
parser.add_argument('-R', '--random', help='display n random wikipedia articles (1 <= n <= 10)',
type=int, choices=[i for i in range(1,11)])
parser.add_argument('-r', '--read', help='display the specified summarized wikipedia article', type=str, nargs='+')
parser.add_argument('-rf', '--forever', help='display a random article until the user types stop',
action="store_true")
评论列表
文章目录