Skip to content

Commit

Permalink
easier usage
Browse files Browse the repository at this point in the history
  • Loading branch information
EliaOndacs committed Jul 15, 2024
1 parent 4e77ce4 commit eee2c07
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wttr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def getArg(idx: int,detail):
return sys.argv[idx]
else:
print(f"wttr {detail["command"]} ****")
print(f"expected argument where{" "*int(len(detail["command"])-16)}^^ ")
print(f"expected argument where{" "*abs(int(len(detail["command"])-16))}^^ ")
print(f"reason:\n{detail["reason"]}")
sys.exit(1)

Expand Down Expand Up @@ -37,6 +37,9 @@ def Failed(text: str):
print("Unofficial wttr.in cli tool")
Usage()
case _:
print("Unofficial wttr.in cli tool")
Usage()
response = requests.get(BASE+"/"+getArg(2,{"command":"","reason":"require a location or a domain"}))
if response.ok:
print(response.text)
else:
Failed(response.reason)

0 comments on commit eee2c07

Please sign in to comment.