def add_log_args(self):
"""
Add arguments for log manipulations
:return:
"""
self.log_parser = self.subparsers.add_parser('log', help="Manipulations for logs",
formatter_class=argparse.RawTextHelpFormatter)
self.log_parser.add_argument('action', choices=['list', 'get'])
# To get multiline help msgs:
# http://stackoverflow.com/questions/3853722/python-argparse-how-to-insert-newline-in-the-help-text
self.log_parser.add_argument('--limit', '-l', type=int, default=100, required=False)
self.log_parser.add_argument('--device_list', '-n', type=str, required=False)
self.log_parser.add_argument('--begin', '-b', required=False)
self.log_parser.add_argument('--end', '-e', required=False)
# self.log_parser.add_argument('options', nargs='*', help='''key=value pairs used to assist in selecting
# and setting attributes
# More
# ... and more
# ...and more!''')
self.log_parser.set_defaults(func=self.log_execute)
评论列表
文章目录