fix(smartcli): Allow passing argv to startParse and improve getUserArgs Deno/runtime handling; update tests and add license
This commit is contained in:
@@ -123,10 +123,11 @@ export class Smartcli {
|
||||
|
||||
/**
|
||||
* start the process of evaluating commands
|
||||
* @param testArgv - Optional argv override for testing (bypasses automatic runtime detection)
|
||||
*/
|
||||
public startParse(): void {
|
||||
public startParse(testArgv?: string[]): void {
|
||||
// Get user arguments, properly handling Node.js, Deno (run/compiled), and Bun
|
||||
const userArgs = getUserArgs();
|
||||
const userArgs = testArgv ? getUserArgs(testArgv) : getUserArgs();
|
||||
const parsedYArgs = plugins.yargsParser(userArgs);
|
||||
const wantedCommand = parsedYArgs._[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user