1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/CliClient/app/command-status.js
2017-07-13 18:09:47 +00:00

37 lines
724 B
JavaScript

import { BaseCommand } from './base-command.js';
import { _ } from 'lib/locale.js';
import { ReportService } from 'lib/services/report.js';
class Command extends BaseCommand {
usage() {
return 'status';
}
description() {
return 'Displays summary about the notes and notebooks.';
}
async action(args) {
let service = new ReportService();
let report = await service.status();
for (let i = 0; i < report.length; i++) {
let section = report[i];
if (i > 0) this.log('');
this.log('# ' + section.title);
this.log('');
for (let n in section.body) {
if (!section.body.hasOwnProperty(n)) continue;
let line = section.body[n];
this.log(line);
}
}
}
}
module.exports = Command;