pmake/src/js/cmdline.js

19 lines
572 B
JavaScript
Raw Normal View History

2026-05-08 05:35:07 +09:00
if(ARGV.length == 1) {
2026-05-08 05:18:35 +09:00
console.log("Type '" + ARGV[0] + " --help' for help");
process.exit(1);
}
2026-05-08 05:35:07 +09:00
for(var i = 1; i < ARGV.length; i++) {
if(ARGV[i] == "--help") {
2026-05-08 05:18:35 +09:00
console.log("PMake " + pmake.VERSION + " - Pyrite's build script generator");
console.log("");
console.log("Usage: " + ARGV[0] + " [options] action [arguments]");
process.exit(0);
2026-05-08 05:35:07 +09:00
} else if(ARGV[i].startsWith("--")) {
2026-05-08 05:25:34 +09:00
console.log("Error: invalid option '" + ARGV[i].substr(2) + "'");
process.exit(1);
2026-05-08 05:35:07 +09:00
} else {
2026-05-08 05:25:34 +09:00
console.log("Error: no such action '" + ARGV[i] + "'");
process.exit(1);
2026-05-08 05:18:35 +09:00
}
}