-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45e652a
commit 9aa0115
Showing
4 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
#!/usr/bin/python | ||
# -*- coding: UTF-8 -*- | ||
|
||
import sys | ||
import argparse | ||
|
||
_PARSER = None | ||
|
||
def default_parser(): | ||
return _PARSER | ||
|
||
def configure_parser(description=None): | ||
def configure_parser(args=None, description=None): | ||
global _PARSER | ||
if not _PARSER: | ||
description = description or 'Basic Transformer parser' | ||
args = args or sys.argv[1:] | ||
_PARSER = argparse.ArgumentParser(description=description) | ||
_PARSER.add_argument('-o', '--outdir', default='results', help='output directory') | ||
_PARSER.add_argument('-i', '--input', default='<stdin>', help='input file') | ||
_PARSER.add_argument('--debug', action='store_true', help='enter debug mode') | ||
_PARSER.add_argument('-q', '--quiet', action='store_true', help='quiet mode, no output') | ||
_PARSER.add_argument('-p', '--rows', default=0, type=int, help='input rows to print') | ||
return _PARSER.parse_args() | ||
return _PARSER.parse_args(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters