Skip to content

Commit

Permalink
Improve comments and default for mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
phBalance committed Oct 16, 2019
1 parent 59b6b49 commit 2c57343
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions command_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ const parseArgs = require("minimist");

const DEFAULT = {
PORT: 8080,
LOGLEVEL: log.levels.INFO
LOGLEVEL: log.levels.INFO,
MODE: "444"
};

const options = [
{ name: "blacklist", param: "item", desc: `Regex describing files which should not be included in the rendering.` },
{ name: "cert", param: "cert", desc: `SSL Certificate to use.` },
{ name: "key", param: "key", desc: `SSL Key to use.` },
{ name: "drop", param: "toUid:toGid", desc: `The uid and gid that the process should become as soon as possible.` },
{ name: "drop", param: "toUid:toGid", desc: `The uid and gid, separated by a colon, that the process should become as soon as possible.` },
{ name: "early", param: "urlToEarlyRender", desc: `A URL that should be rendered before listening for requests. Specify multiple times for many URLs.` },
{ name: "loglevel", param: "0-5", desc: `Set log levels (according to the loglevel package) to this number. Default is ${DEFAULT.LOGLEVEL}.` },
{ name: "map", param: "hostMapping", desc: `Array of JSON objects with from and to properties.` },
Expand All @@ -24,12 +25,12 @@ const options = [
{ name: "public", param: "staticFileDirectory", desc: `Serve static files from this directory.` },
{ name: "copyToDir", param: "directoryToPutRenderedFile", desc: `Generate a file for each page that is rendered.` },
{ name: "fileExt", param: "extension", desc: `Add extension to all files that are generated. For instance, it might be useful to add ".html".` },
{ name: "mode", param: "fileMode", desc: `Sets the file mode to be set when files are written.` },
{ name: "mode", param: "fileMode", desc: `Sets the file mode to be set when files are written. Default is (octal) ${DEFAULT.MODE}.` },

{ name: "compress", desc: `Allows on the fly compression of reponses.` },
{ name: "headfull", desc: `Show the normally headless chrome. Useful for debugging.` },
{ name: "help", desc: `Show the usage description.` },
{ name: "noserver", desc: `Don't start a server to listen for incoming requests. In other words, just run with files.` },
{ name: "noserver", desc: `Don't start a server to listen for incoming requests. In other words, just run as a prerender.` },
];

const opts = {
Expand Down Expand Up @@ -73,7 +74,7 @@ parsed.port = parsed.port ? parseInt(parsed.port) : DEFAULT.PORT;
parsed.public = parsed.public && path.resolve(parsed.public);
parsed.headless = !parsed.headfull;
parsed.server = !parsed.noserver;
parsed.mode = parsed.mode || "444";
parsed.mode = parsed.mode || DEFAULT.MODE;
parsed.fileExt = parsed.fileExt || "";

try {
Expand Down

0 comments on commit 2c57343

Please sign in to comment.