fix(smartcli.helpers): Improve CLI argument parsing and Deno runtime detection; use getUserArgs consistently
This commit is contained in:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user