surplus: add --version flag implements #10
This commit is contained in:
parent
822874e0e9
commit
e29050ae6b
12
surplus.py
12
surplus.py
|
@ -471,7 +471,7 @@ def cli() -> None:
|
||||||
"query",
|
"query",
|
||||||
type=str,
|
type=str,
|
||||||
help="full-length Plus Code (6PH58QMF+FX), local code (8QMF+FX Singapore), or latlong (1.3336875, 103.7749375)",
|
help="full-length Plus Code (6PH58QMF+FX), local code (8QMF+FX Singapore), or latlong (1.3336875, 103.7749375)",
|
||||||
nargs="+",
|
nargs="*",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-d",
|
"-d",
|
||||||
|
@ -480,6 +480,13 @@ def cli() -> None:
|
||||||
default=False,
|
default=False,
|
||||||
help="prints lat, long and reverser response dict to stderr",
|
help="prints lat, long and reverser response dict to stderr",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-v",
|
||||||
|
"--version",
|
||||||
|
action="store_true",
|
||||||
|
default=False,
|
||||||
|
help="prints version information to stderr and exits",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
stderr.write(
|
stderr.write(
|
||||||
|
@ -488,6 +495,9 @@ def cli() -> None:
|
||||||
+ "\n"
|
+ "\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if args.version:
|
||||||
|
exit()
|
||||||
|
|
||||||
if args.debug:
|
if args.debug:
|
||||||
stderr.write("debug: args.query='" + " ".join(args.query) + "'\n")
|
stderr.write("debug: args.query='" + " ".join(args.query) + "'\n")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue