s3si.ts/s3si.ts

51 lines
1.8 KiB
TypeScript
Raw Normal View History

2022-10-21 07:09:30 -04:00
import { App, DEFAULT_OPTS } from "./src/app.ts";
import { showError } from "./src/utils.ts";
import { flags } from "./deps.ts";
2022-10-18 09:16:51 -04:00
const parseArgs = (args: string[]) => {
const parsed = flags.parse(args, {
string: ["profilePath", "exporter", "skipMode", "listMethod"],
2023-03-05 07:01:48 -05:00
boolean: ["help", "noProgress", "monitor", "withSummary"],
2022-10-18 09:16:51 -04:00
alias: {
"help": "h",
2022-10-20 09:45:59 -04:00
"profilePath": ["p", "profile-path"],
"exporter": ["e"],
2022-10-20 10:05:58 -04:00
"noProgress": ["n", "no-progress"],
2022-10-22 18:52:08 -04:00
"monitor": ["m"],
2022-10-24 14:45:36 -04:00
"skipMode": ["s", "skip-mode"],
2022-11-26 10:01:42 -05:00
"withSummary": "with-summary",
"listMethod": "list-method",
2022-10-20 09:45:59 -04:00
},
2022-10-18 09:16:51 -04:00
});
return parsed;
};
2022-10-22 09:00:45 -04:00
const opts = parseArgs(Deno.args);
if (opts.help) {
console.log(
`Usage: deno run -A ${Deno.mainModule} [options]
Options:
--profile-path <path>, -p Path to config file (default: ./profile.json)
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
Multiple exporters can be separated by commas
(e.g. "stat.ink,file")
--list-method When set to "latest", the latest 50 matches will be obtained.
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
2023-06-06 07:37:52 -04:00
"latest" is the default setting.
2022-10-22 09:00:45 -04:00
--no-progress, -n Disable progress bar
2022-10-24 14:45:36 -04:00
--monitor, -m Monitor mode
--skip-mode <mode>, -s Skip mode (default: null)
("vs", "coop")
2022-11-26 10:01:42 -05:00
--with-summary Include summary in the output
2022-10-22 09:00:45 -04:00
--help Show this help message and exit`,
);
Deno.exit(0);
}
2022-10-18 09:16:51 -04:00
const app = new App({
...DEFAULT_OPTS,
2022-10-22 09:00:45 -04:00
...opts,
2022-10-18 09:16:51 -04:00
});
await showError(app.env, app.run());