Skip to content

Commit

Permalink
Fix command description
Browse files Browse the repository at this point in the history
  • Loading branch information
cb1kenobi committed Jan 22, 2024
1 parent 98d9277 commit 7546842
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ export class CLI {
* @access private
*/
initGlobals() {
this.command = program;
program
.name('titanium')
.allowUnknownOption()
Expand Down Expand Up @@ -784,6 +783,8 @@ export class CLI {
program.help();
}
});

this.command = program;
}

/**
Expand Down Expand Up @@ -854,11 +855,13 @@ export class CLI {
this.debugLogger.trace(`loadCommand('${cmdName}')`);

let commandFile;
let desc;
let desc = '';

if (commands[cmdName]) {
desc = commands[cmdName];
commandFile = join(import.meta.url, `../commands/${cmdName}.js`);
} else if (sdkCommands[cmdName]) {
desc = sdkCommands[cmdName];
commandFile = pathToFileURL(join(this.sdk.path, `cli/commands/${cmdName}.js`));
} else if (this.customCommands[cmdName]) {
commandFile = pathToFileURL(this.customCommands[cmdName]);
Expand Down Expand Up @@ -950,7 +953,7 @@ export class CLI {
this.debugLogger.trace(`Found custom command "${name}"`);
this.customCommands[name] = file;

this.command
program
.command(name)
.allowUnknownOption()
.action((...args) => this.executeCommand(args));
Expand Down

0 comments on commit 7546842

Please sign in to comment.