fix(smartcli.helpers): Improve CLI argument parsing and Deno runtime detection; use getUserArgs consistently

This commit is contained in:
2025-10-28 14:59:46 +00:00
parent e905af4b21
commit 913f8556d0
5 changed files with 55 additions and 28 deletions

View File

@@ -92,7 +92,7 @@ export class Smartcli {
* getOption
*/
public getOption(optionNameArg: string) {
const userArgs = getUserArgs(process.argv);
const userArgs = getUserArgs();
const parsedYargs = plugins.yargsParser(userArgs);
return parsedYargs[optionNameArg];
}
@@ -126,8 +126,7 @@ export class Smartcli {
*/
public startParse(): void {
// Get user arguments, properly handling Node.js, Deno (run/compiled), and Bun
// Pass process.argv explicitly to handle test scenarios where it's modified
const userArgs = getUserArgs(process.argv);
const userArgs = getUserArgs();
const parsedYArgs = plugins.yargsParser(userArgs);
const wantedCommand = parsedYArgs._[0];