Skip to content

Commit

Permalink
Merge pull request #25 from esfalsa/master
Browse files Browse the repository at this point in the history
Add CLI flags for custom update lengths
  • Loading branch information
khronion authored Nov 2, 2022
2 parents 2fea6ae + da320d0 commit 5c24e4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ underscores instead of spaces.
the current working directory.
-l PATH Write debug log to specified path.
-m Generate a minimized sheet without WFEs and embassies
-maj LENGTH Specify custom length of major update, in seconds.
-min LENGTH Specify custom length of minor update, in seconds.
If run without arguments, Spyglass runs in interactive mode and outputs to its
working directory.
Expand Down
12 changes: 11 additions & 1 deletion Spyglass-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def download_dump() -> None:
the current working directory.
-l PATH Write debug log to specified path.
-m Generate a minimized sheet without WFEs and embassies
-maj LENGTH Specify custom length of major update, in seconds.
-min LENGTH Specify custom length of minor update, in seconds.
"""
)
print(
Expand All @@ -109,6 +111,14 @@ def download_dump() -> None:
if "-n" in argv:
interactive = False
UAgent = argv[argv.index("-n") + 1]

if "-min" in argv:
MinorTime = int(argv[argv.index("-min") + 1])
if "-maj" in argv:
MajorTime = int(argv[argv.index("-maj") + 1])
if "-min" in argv or "-maj" in argv:
SpeedOverride = True

else:
print(f"Spyglass {VERSION}: Generate NationStates region update timesheets.")
UAgent = input("Nation Name: ")
Expand Down Expand Up @@ -444,4 +454,4 @@ def download_dump() -> None:
write_log(f"INFO Successfully saved to {filename}")
write_log(f"INFO Spyglass run complete. Exiting...")

raise SystemExit(0)
raise SystemExit(0)

0 comments on commit 5c24e4a

Please sign in to comment.