occam-verify-cli 0.0.792 → 0.0.794

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,7 @@
3
3
  function helpAction() {
4
4
  console.log(`Usage:
5
5
 
6
- verify [<options>] [<argument>] Verify the specified project
7
-
8
- verify [<command>] [<options>] [<argument>]
6
+ verify [<options>] [<command>] [<argument>]
9
7
 
10
8
  Commands:
11
9
 
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ const { DEFAULT_HELP, DEFAULT_VERSION } = require("./defaults"),
4
+ { HELP_COMMAND, VERSION_COMMAND } = require("./commands");
5
+
6
+ function configure(command, argument, options, main) {
7
+ const { help = DEFAULT_HELP, version = DEFAULT_VERSION } = options;
8
+
9
+ if (false) {
10
+ ///
11
+ } else if (help) {
12
+ command = HELP_COMMAND;
13
+ } else if (version) {
14
+ command = VERSION_COMMAND;
15
+ }
16
+
17
+ main(command, argument, options);
18
+ }
19
+
20
+ module.exports = configure;
package/bin/main.js CHANGED
@@ -6,30 +6,26 @@ const helpAction = require("./action/help"),
6
6
  verifyAction = require("./action/verify"),
7
7
  versionAction = require("./action/version");
8
8
 
9
- const { HELP_COMMAND, VERIFY_COMMAND, VERSION_COMMAND } = require("./commands"),
10
- { DEFAULT_HELP, DEFAULT_TAIL, DEFAULT_FOLLOW, DEFAULT_VERSION, DEFAULT_LOG_LEVEL } = require("./defaults");
9
+ const { NO_COMMAND_GIVEN_MESSAGE } = require("./messages"),
10
+ { HELP_COMMAND, VERIFY_COMMAND, VERSION_COMMAND } = require("./commands"),
11
+ { DEFAULT_TAIL, DEFAULT_FOLLOW, DEFAULT_LOG_LEVEL } = require("./defaults");
11
12
 
12
13
  function main(command, argument, options) {
13
- const commandMissing = (command === null),
14
- { help = DEFAULT_HELP,
15
- tail = DEFAULT_TAIL,
14
+ const { tail = DEFAULT_TAIL,
16
15
  follow = DEFAULT_FOLLOW,
17
- version = DEFAULT_VERSION,
18
16
  logLevel = DEFAULT_LOG_LEVEL } = options;
19
17
 
20
- if (false) {
21
- ///
22
- } else if (help) {
23
- command = HELP_COMMAND;
24
- } else if (version) {
25
- command = VERSION_COMMAND;
26
- } else if (commandMissing) {
27
- command = HELP_COMMAND;
28
- }
29
-
30
18
  const log = Log.fromFollowAndLogLevel(follow, logLevel);
31
19
 
32
20
  switch (command) {
21
+ case null: {
22
+ console.log(NO_COMMAND_GIVEN_MESSAGE);
23
+
24
+ process.exit(1);
25
+
26
+ break;
27
+ }
28
+
33
29
  case HELP_COMMAND: {
34
30
  helpAction();
35
31
 
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ const NO_COMMAND_GIVEN_MESSAGE = "No command has been given.";
4
+
5
+ module.exports = {
6
+ NO_COMMAND_GIVEN_MESSAGE
7
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "occam-verify-cli",
3
3
  "author": "James Smith",
4
- "version": "0.0.792",
4
+ "version": "0.0.794",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/occam-verify-cli",
7
7
  "description": "Occam's Verifier",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@swc/core": "^1.5.6",
23
- "watchful-cli": "^1.7.44"
23
+ "watchful-cli": "^1.7.51"
24
24
  },
25
25
  "scripts": {
26
26
  "clean": "rm -rf ./lib",
package/verify.js CHANGED
@@ -4,6 +4,7 @@ const { parseArgv } = require("argumentative"),
4
4
  { arrayUtilities } = require("necessary");
5
5
 
6
6
  const main = require("./bin/main"),
7
+ configure = require("./bin/configure"),
7
8
  abbreviations = require("./bin/abbreviations");
8
9
 
9
10
  const { argv } = process,
@@ -15,4 +16,4 @@ const { commands, options } = parseArgv(argv, abbreviations),
15
16
  command = firstCommand || null, ///
16
17
  argument = secondCommand || null; ///
17
18
 
18
- main(command, argument, options);
19
+ configure(command, argument, options, main);