noninteractive 0.3.24 → 0.3.25
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/noninteractive.js +18 -2
- package/package.json +1 -1
package/bin/noninteractive.js
CHANGED
|
@@ -377,7 +377,7 @@ var init_daemon = __esm(() => {
|
|
|
377
377
|
var require_package = __commonJS((exports, module) => {
|
|
378
378
|
module.exports = {
|
|
379
379
|
name: "noninteractive",
|
|
380
|
-
version: "0.3.
|
|
380
|
+
version: "0.3.25",
|
|
381
381
|
type: "module",
|
|
382
382
|
bin: {
|
|
383
383
|
noninteractive: "./bin/noninteractive.js"
|
|
@@ -833,7 +833,9 @@ async function main() {
|
|
|
833
833
|
if (startArgs.length < 1) {
|
|
834
834
|
console.error(`usage: noninteractive start <cmd> [args...]
|
|
835
835
|
|
|
836
|
-
|
|
836
|
+
examples:
|
|
837
|
+
npx noninteractive start npx eslint --init
|
|
838
|
+
npx noninteractive eslint --init # shorthand (auto-starts with npx)`);
|
|
837
839
|
process.exit(1);
|
|
838
840
|
}
|
|
839
841
|
return start(startArgs, noOpen);
|
|
@@ -899,6 +901,20 @@ example: npx noninteractive stop vercel`);
|
|
|
899
901
|
console.log(HELP);
|
|
900
902
|
break;
|
|
901
903
|
default: {
|
|
904
|
+
const niFlags = ["--name", "--cwd", "--dir", "--session"];
|
|
905
|
+
const firstPositional = args.findIndex((a) => !a.startsWith("-") && a !== "--");
|
|
906
|
+
const flagsBefore = firstPositional === -1 ? args : args.slice(0, firstPositional);
|
|
907
|
+
const wrongFlag = flagsBefore.find((a) => niFlags.includes(a.split("=")[0]));
|
|
908
|
+
if (wrongFlag) {
|
|
909
|
+
console.error(`unknown flag: ${wrongFlag}
|
|
910
|
+
|
|
911
|
+
hint: ${wrongFlag} is not supported. the session name is auto-derived from the command.`);
|
|
912
|
+
console.error(`
|
|
913
|
+
examples:
|
|
914
|
+
npx noninteractive eslint --init # auto-start, session = "eslint"
|
|
915
|
+
npx noninteractive start npx eslint --init # explicit start`);
|
|
916
|
+
process.exit(1);
|
|
917
|
+
}
|
|
902
918
|
const noOpen = args.includes("--no-open");
|
|
903
919
|
const filteredArgs = args.filter((a) => a !== "--no-open");
|
|
904
920
|
console.log(`[installing and running: npx ${filteredArgs.join(" ")}]`);
|