You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-17 23:27:48 +02:00
Help
This commit is contained in:
34
CliClient/app/command-help.js
Normal file
34
CliClient/app/command-help.js
Normal file
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user