Skip to content

Commit

Permalink
added descriptions to CLI options
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed May 8, 2022
1 parent 1701c27 commit 7b1fe19
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
13 changes: 13 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,61 +18,74 @@ const sharedOpts = {
c: {
alias: "collapse",
default: true,
description: "When using `match all <template>` option value, collapses all *.stackexchange.com sites into one wildcard match",
type: "boolean",
},
d: {
alias: "direct",
default: false,
description: "Directs headers content to `process.stdout`",
type: "boolean",
},
e: {
alias: "eol",
default: "\n",
description: "Sets the end-of-line character(s) (affects the check for existing headers)",
type: "string",
},
g: {
alias: "grant",
description: "generates @grant headers, can be repeated",
type: "array",
},
i: {
alias: "inject",
description: "Adds @inject-into header for Violentmonkey, no-op otherwise",
type: "string",
},
m: {
alias: "match",
description: "generates valid @match headers (repeatable)",
type: "array",
},
o: {
alias: "output",
default: "./dist/headers.js",
description: "Creates and populates a file with headers content",
type: "string",
},
p: {
alias: "package",
default: "./package.json",
description: "Path to package.json to extract info from",
type: "string",
},
q: {
alias: "require",
description: "generates valid @require headers (repeatable)",
type: "array"
},
r: {
alias: "run",
default: "start",
description: "Adds @run-at header (values missing in manager are silently dropped)",
type: "string",
},
s: {
alias: "spaces",
default: 4,
description: "number of spaces to indent header values with (total is the longest name + this value)",
type: "number",
},
w: {
alias: "whitelist",
description: "generates @connect headers (repeatable)",
type: "array",
},
pretty: {
type: "boolean",
default: false,
description: "prettifies outputted headers where possible",
},
};
names.forEach((name) => cli.command(name, `generates ${(0, common_1.scase)(name)} headers`, sharedOpts, ({ c, d, e, g = [], i, m = [], q = [], o, p, r = "start", s, pretty, w = [] }) => void (0, generate_1.generate)(name, {
Expand Down
6 changes: 5 additions & 1 deletion dist/utils/filesystem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down
6 changes: 5 additions & 1 deletion dist/utils/validators.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down
13 changes: 13 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,74 @@ const sharedOpts = {
c: {
alias: "collapse",
default: true,
description: "When using `match all <template>` option value, collapses all *.stackexchange.com sites into one wildcard match",
type: "boolean",
},
d: {
alias: "direct",
default: false,
description: "Directs headers content to `process.stdout`",
type: "boolean",
},
e: {
alias: "eol",
default: "\n",
description: "Sets the end-of-line character(s) (affects the check for existing headers)",
type: "string",
},
g: {
alias: "grant",
description: "generates @grant headers, can be repeated",
type: "array",
},
i: {
alias: "inject",
description: "Adds @inject-into header for Violentmonkey, no-op otherwise",
type: "string",
},
m: {
alias: "match",
description: "generates valid @match headers (repeatable)",
type: "array",
},
o: {
alias: "output",
default: "./dist/headers.js",
description: "Creates and populates a file with headers content",
type: "string",
},
p: {
alias: "package",
default: "./package.json",
description: "Path to package.json to extract info from",
type: "string",
},
q: {
alias: "require",
description: "generates valid @require headers (repeatable)",
type: "array"
},
r: {
alias: "run",
default: "start",
description: "Adds @run-at header (values missing in manager are silently dropped)",
type: "string",
},
s: {
alias: "spaces",
default: 4,
description: "number of spaces to indent header values with (total is the longest name + this value)",
type: "number",
},
w: {
alias: "whitelist",
description: "generates @connect headers (repeatable)",
type: "array",
},
pretty: {
type: "boolean",
default: false,
description: "prettifies outputted headers where possible",
},
} as const;

Expand Down

0 comments on commit 7b1fe19

Please sign in to comment.