mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-15 09:04:04 +02:00
36 lines
845 B
JavaScript
36 lines
845 B
JavaScript
import { BaseCommand } from './base-command.js';
|
|
import { app } from './app.js';
|
|
import { renderCommandHelp } from './help-utils.js';
|
|
import { Database } from 'lib/database.js';
|
|
import { Setting } from 'lib/models/setting.js';
|
|
import { _ } from 'lib/locale.js';
|
|
import { ReportService } from 'lib/services/report.js';
|
|
|
|
class Command extends BaseCommand {
|
|
|
|
usage() {
|
|
return 'help [command]';
|
|
}
|
|
|
|
description() {
|
|
return _('Displays usage information.');
|
|
}
|
|
|
|
async action(args) {
|
|
const commands = args['command'] ? [app().findCommandByName(args['command'])] : app().commands();
|
|
|
|
let output = [];
|
|
for (let n in commands) {
|
|
if (!commands.hasOwnProperty(n)) continue;
|
|
const command = commands[n];
|
|
output.push(renderCommandHelp(command));
|
|
}
|
|
|
|
output.sort();
|
|
|
|
this.stdout(output.join("\n\n"));
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = Command; |