Sam Therapy
261856a128
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Sam Therapy <sam@samtherapy.net>
44 lines
935 B
TypeScript
44 lines
935 B
TypeScript
import commandLineArgs from "command-line-args";
|
|
import commandLineUsage from "command-line-usage";
|
|
import { exit } from "process";
|
|
const optionDefinitions = [
|
|
{
|
|
name: "help",
|
|
type: Boolean,
|
|
alias: "h",
|
|
description: "Print this usage guide.",
|
|
},
|
|
{
|
|
name: "verbose",
|
|
type: Boolean,
|
|
alias: "v",
|
|
description: "Print debugging output.",
|
|
},
|
|
];
|
|
const args = commandLineArgs(optionDefinitions);
|
|
if (args.help) {
|
|
const usage = commandLineUsage([
|
|
{
|
|
header: "Fediverse Token Grabber",
|
|
content:
|
|
"Grabs Masotodon, Pleroma or Misskey tokens for your bots to use.",
|
|
},
|
|
{
|
|
header: "Options",
|
|
optionList: optionDefinitions,
|
|
},
|
|
{
|
|
content:
|
|
"Project home: {underline https://git.froth.zone/sam/js-feditoken}",
|
|
},
|
|
]);
|
|
console.log(usage);
|
|
exit(0);
|
|
}
|
|
|
|
if (args.verbose) {
|
|
console.log("Running in verbose mode.\n");
|
|
}
|
|
|
|
export default args;
|