Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
Merge pull request #11 from markjoshwel/future
Browse files Browse the repository at this point in the history
Add -v/--version flag
  • Loading branch information
markjoshwel authored Jun 18, 2023
2 parents 822874e + e29050a commit 65b029a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion surplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def cli() -> None:
"query",
type=str,
help="full-length Plus Code (6PH58QMF+FX), local code (8QMF+FX Singapore), or latlong (1.3336875, 103.7749375)",
nargs="+",
nargs="*",
)
parser.add_argument(
"-d",
Expand All @@ -480,6 +480,13 @@ def cli() -> None:
default=False,
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()

stderr.write(
Expand All @@ -488,6 +495,9 @@ def cli() -> None:
+ "\n"
)

if args.version:
exit()

if args.debug:
stderr.write("debug: args.query='" + " ".join(args.query) + "'\n")

Expand Down

0 comments on commit 65b029a

Please sign in to comment.