Skip to content

Commit

Permalink
moving help above mallprices & main.php check (#2201)
Browse files Browse the repository at this point in the history
* moving help above mallprices & main.php check

* move `Args.fill` to make this work

---------

Co-authored-by: horrible little slime <[email protected]>
  • Loading branch information
docrostov and horrible-little-slime authored Jan 24, 2025
1 parent 718044e commit a32d043
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/garbo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ export function main(argString = ""): void {
sinceKolmafiaRevision(28151); // detect TakerSpace + basic related functionality
checkGithubVersion();

Args.fill(globalOptions, argString);
// Instant returns placed before visiting anything.
if (globalOptions.version) return; // Since we always print the version, all done!
if (globalOptions.help) {
Args.showHelp(globalOptions);
return;
}

// Hit up main.php to get out of easily escapable choices
visitUrl("main.php");
if (currentRound() > 0) {
Expand All @@ -130,17 +138,11 @@ export function main(argString = ""): void {

allMallPrices();

Args.fill(globalOptions, argString);
if (globalOptions.target === $monster.none) {
globalOptions.target = defaultTarget();
}

globalOptions.prefs.yachtzeechain = false;
if (globalOptions.version) return; // Since we always print the version, all done!
if (globalOptions.help) {
Args.showHelp(globalOptions);
return;
}

if (globalOptions.turns) {
if (globalOptions.turns >= 0) {
Expand Down

0 comments on commit a32d043

Please sign in to comment.