def _get_arg_parser(self, doc_parser=False):
description = textwrap.dedent(__doc__)
parser = argparse.ArgumentParser(description=description, formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('items', metavar='items', type=str, nargs='*', help='the directory or file(s)',
default=None).completer = FilesCompleter()
parser.add_argument('-c', '--config', type=str,
help='Use the given initial configuration').completer = \
FilesCompleter(['conf'], directories=False)
parser.add_argument('-m', '--maximize', action='store_true', help="Maximize the shown window")
parser.add_argument('--to-file', type=str, help="If set export the figure to the given filename")
parser.add_argument('--width', type=int, help="The width of the output file when --to-file is set")
parser.add_argument('--height', type=int, help="The height of the output file when --to-file is set")
parser.add_argument('--dpi', type=int, help="The dpi of the output file when --to-file is set")
return parser
评论列表
文章目录