commit 075471063c780a2661c23d7d0e7eefcdb8171e7e
parent f43ff067165a7eca4381b11cfc696a8df3fdd317
Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 10 Dec 2023 21:35:10 +0100
Add position parameter.
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/akupunktuhr b/akupunktuhr
@@ -245,12 +245,12 @@ def solar2lunar(solardt):
def usage(app):
app = os.path.basename(app)
- print("usage: %s [-h]" % (app), file=sys.stderr)
+ print("usage: %s [-h] [-p lat,lon]" % (app), file=sys.stderr)
sys.exit(1)
def main(args):
try:
- opts, largs = getopt.getopt(args[1:], "h")
+ opts, largs = getopt.getopt(args[1:], "p:h")
except getopt.GetoptError as err:
print(str(err))
usage(args[0])
@@ -261,6 +261,10 @@ def main(args):
for o, a in opts:
if o == "-h":
usage(args[0])
+ elif o == "-p":
+ (lats, lons) = a.split(",", 1)
+ latitude = float(lats)
+ longitude = float(lons)
else:
assert False, "unhandled option"