whet 0.0.16 → 0.0.17
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.
- package/bin/whet/Whet.js +7 -2
- package/package.json +1 -1
package/bin/whet/Whet.js
CHANGED
|
@@ -2,7 +2,7 @@ import {Project} from "./Project.js"
|
|
|
2
2
|
import {LogLevel, Log} from "./Log.js"
|
|
3
3
|
import * as Url from "url"
|
|
4
4
|
import {Register} from "../genes/Register.js"
|
|
5
|
-
import {Command} from "commander"
|
|
5
|
+
import {Command, CommanderError} from "commander"
|
|
6
6
|
import {Std} from "../Std.js"
|
|
7
7
|
|
|
8
8
|
const $global = Register.$global
|
|
@@ -10,7 +10,7 @@ const $global = Register.$global
|
|
|
10
10
|
export const Whet_Fields_ = Register.global("$hxClasses")["whet._Whet.Whet_Fields_"] =
|
|
11
11
|
class Whet_Fields_ {
|
|
12
12
|
static main() {
|
|
13
|
-
Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.
|
|
13
|
+
Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.17", "-v, --version").allowUnknownOption(true).showSuggestionAfterError(true).option("-p, --project <file>", "project to run", "Project.mjs").option("-l, --log-level <level>", "log level, a string/number", "info").exitOverride();
|
|
14
14
|
Whet_Fields_.program.parse();
|
|
15
15
|
var options = Whet_Fields_.program.opts();
|
|
16
16
|
if (options.logLevel != null) {
|
|
@@ -87,6 +87,11 @@ class Whet_Fields_ {
|
|
|
87
87
|
Log.log(10, ...["Executing command.", {"commandArgs": c}]);
|
|
88
88
|
Whet_Fields_.program.parseAsync(c, {"from": "user"}).then(function (_) {
|
|
89
89
|
nextCommand();
|
|
90
|
+
})["catch"](function (err) {
|
|
91
|
+
if (((err) instanceof CommanderError) && err.code == "commander.help") {
|
|
92
|
+
return;
|
|
93
|
+
};
|
|
94
|
+
Log.log(50, ...["Error while executing command.", {"error": err}]);
|
|
90
95
|
});
|
|
91
96
|
};
|
|
92
97
|
initProm.then(function (_) {
|