Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/views/resources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ class ResourceIndexView extends AppView {
}
}

render() {
render(format = null) {
if (this.data.length === 0) {
console.log('No resources to display. Create one first!');
} else if (format == 'json') {
console.log(JSON.stringify(this.data));
} else {
console.log(this.columnify(this.data, {
minWidth: 20,
Expand Down
3 changes: 2 additions & 1 deletion passbolt-find.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const {list} = require('./app/lib/coercion');
.option('-u, --fingerprint <fingerprint>', 'The user key fingerprint to authenticate with')
.option('-p, --passphrase <passphrase>', 'The key passphrase')
.option('--columns <items>', 'Coma separated columns to display', list)
.option('--json', 'Output resources in JSON format')
.option('-v, --verbose', 'Display additional debug information')
.parse(process.argv);

Expand All @@ -33,7 +34,7 @@ const {list} = require('./app/lib/coercion');
try {
let data = await resourceController.index();
const view = new ResourceIndexView(data, program.opts().columns);
view.render();
view.render(program.opts().json ? 'json' : null);
} catch (err) {
resourceController.error(err);
}
Expand Down