feat(nav): add --list option
This commit is contained in:
parent
b9d83cac68
commit
1f9f295c48
1 changed files with 5 additions and 0 deletions
5
nav.py
5
nav.py
|
|
@ -2,6 +2,7 @@
|
||||||
"""Navigation computer of the SS Probably Fine.
|
"""Navigation computer of the SS Probably Fine.
|
||||||
|
|
||||||
Usage: python3 nav.py DESTINATION
|
Usage: python3 nav.py DESTINATION
|
||||||
|
python3 nav.py --list
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
@ -64,6 +65,10 @@ def plan(destination):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
if sys.argv[1] == "--list":
|
||||||
|
for key in sorted(ROUTES):
|
||||||
|
print(f"{key:12} {NAMES[key]}")
|
||||||
|
return
|
||||||
destination = sys.argv[1]
|
destination = sys.argv[1]
|
||||||
if destination not in ROUTES:
|
if destination not in ROUTES:
|
||||||
known = ", ".join(sorted(ROUTES))
|
known = ", ".join(sorted(ROUTES))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue