Rewrite comments

1ef04ffc4dc7d4be5e2cc499bfe1154b0490f4a1

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +16 -19Ignore whitespace
src/command-line.js+16 -19
@@ -34,12 +34,8 @@ import { canResolve, color, getConfigValue, stringToBool } from './util.js';
3434 */
3535
3636/**
37- * Gets the hostname to use for autorun in the browser.
37+ * Provides a command line arguments parser.
38- * @param {boolean} useIPv6 If use IPv6
39- * @param {boolean} useIPv4 If use IPv4
40- * @returns {Promise<string>} The hostname to use for autorun
4138 */
42-
4339export class CommandLineParser {
4440 constructor() {
4541 /** @type {CommandLineArguments} */
@@ -85,32 +81,33 @@ export class CommandLineParser {
8581
8682 /**
8783 * Parses command line arguments.
84+ * Arguments that are not provided will be filled with config values.
8885 * @param {string[]} args Process startup arguments.
8986 * @returns {CommandLineArguments} Parsed command line arguments.
9087 */
9188 parse(args) {
9289 const cliArguments = yargs(hideBin(args))
9390 .usage('Usage: <your-start-script> <command> [options]\nOptions that are not provided will be filled with config values.')
9491 .option('enableIPv6', {
9592 type: 'string',
9693 default: null,
9794 describe: 'Enables IPv6 protocol.',
9895 }).option('enableIPv4', {
9996 type: 'string',
10097 default: null,
10198 describe: 'Enables IPv4 protocol.',
10299 }).option('port', {
103100 type: 'number',
104101 default: null,
105- describe: 'Sets the port under which SillyTavern will run.\nIf not provided falls back to yaml config \'port\'.',
102+ describe: 'Sets the server listening port',
106103 }).option('dnsPreferIPv6', {
107104 type: 'boolean',
108105 default: null,
109106 describe: 'Prefers IPv6 for DNS\nyounYou should probably have the enabled if you\'re on an IPv6 only network\nIf not provided falls back to yaml config \'dnsPreferIPv6\'.',
110107 }).option('autorun', {
111108 type: 'boolean',
112109 default: null,
113- describe: 'Automatically launch SillyTavern in the browser.\nAutorun is automatically disabled if --ssl is set to true.\nIf not provided falls back to yaml config \'autorun\'.',
110+ describe: 'Automatically launch SillyTavern in the browser',
114111 }).option('autorunHostname', {
115112 type: 'string',
116113 default: null,
@@ -122,23 +119,23 @@ export class CommandLineParser {
122119 }).option('listen', {
123120 type: 'boolean',
124121 default: null,
125- describe: 'SillyTavern is listening on all network interfaces (Wi-Fi, LAN, localhost). If false, will limit it only to internal localhost (127.0.0.1).\nIf not provided falls back to yaml config \'listen\'.',
122+ describe: 'Whether to listen on all network interfaces',
126123 }).option('listenAddressIPv6', {
127124 type: 'string',
128125 default: null,
129126 describe: 'Set SillyTavern to listen to a specificSpecific IPv6 address. If not set, it will fallback to listen to all.',
130127 }).option('listenAddressIPv4', {
131128 type: 'string',
132129 default: null,
133130 describe: 'Set SillyTavern to listen to a specificSpecific IPv4 address. If not set, it will fallback to listen to all.',
134131 }).option('corsProxy', {
135132 type: 'boolean',
136133 default: null,
137134 describe: 'Enables CORS proxy\nIf not provided falls back to yaml config \'enableCorsProxy\'',
138135 }).option('disableCsrf', {
139136 type: 'boolean',
140137 default: null,
141138 describe: 'Disables CSRF protection - NOT RECOMMENDED',
142139 }).option('ssl', {
143140 type: 'boolean',
144141 default: false,
@@ -146,11 +143,11 @@ export class CommandLineParser {
146143 }).option('certPath', {
147144 type: 'string',
148145 default: 'certs/cert.pem',
149146 describe: 'Path to yourSSL certificate file.',
150147 }).option('keyPath', {
151148 type: 'string',
152149 default: 'certs/privkey.pem',
153150 describe: 'Path to yourSSL private key file.',
154151 }).option('whitelist', {
155152 type: 'boolean',
156153 default: null,
@@ -162,7 +159,7 @@ export class CommandLineParser {
162159 }).option('avoidLocalhost', {
163160 type: 'boolean',
164161 default: null,
165162 describe: 'Avoids using \'localhost\' for autorun in auto mode.\nusenUse if you don\'t have \'localhost\' in your hosts file',
166163 }).option('basicAuthMode', {
167164 type: 'boolean',
168165 default: null,