@tertium/hlpr 0.2.0 → 0.3.0
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/index.js +14 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -79,9 +79,20 @@ async function main() {
|
|
|
79
79
|
console.log(`hlpr version ${version}`);
|
|
80
80
|
process.exit(0);
|
|
81
81
|
}
|
|
82
|
-
if (commandArgs.length === 0) {
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
if (commandArgs.length === 0 || commandArgs[0] === "help" || commandArgs[0] === "--help" || commandArgs[0] === "-h" || commandArgs[0] === "/help" || commandArgs[0] === "/h" || commandArgs[0] === "/?") {
|
|
83
|
+
const __filename2 = fileURLToPath(import.meta.url);
|
|
84
|
+
const __dirname2 = path.dirname(__filename2);
|
|
85
|
+
const helpScriptPath = path.join(__dirname2, "commands", "help", "help.ts");
|
|
86
|
+
if (fs.existsSync(helpScriptPath)) {
|
|
87
|
+
const helpCommand = `bun "${helpScriptPath}"`;
|
|
88
|
+
await executeCommand(helpCommand, {});
|
|
89
|
+
rl.close();
|
|
90
|
+
process.exit(0);
|
|
91
|
+
} else {
|
|
92
|
+
console.error("Please provide a command. Example: hlpr ssh init-dir");
|
|
93
|
+
console.error("Run 'hlpr help' for available commands.");
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
85
96
|
}
|
|
86
97
|
try {
|
|
87
98
|
const category = commandArgs[0];
|