1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/CliClient/app/command-help.js
Laurent Cozic 97093feebf Help
2017-08-04 19:11:10 +02:00

34 lines
824 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));
}
this.log(output.join("\n\n"));
}
}
module.exports = Command;