1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00
joplin/CliClient/app/command-status.js
2017-07-24 18:58:11 +00:00

39 lines
848 B
JavaScript

import { BaseCommand } from './base-command.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 'status';
}
description() {
return _('Displays summary about the notes and notebooks.');
}
async action(args) {
let service = new ReportService();
let report = await service.status(Setting.value('sync.target'));
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;