Skip to content

Commit

Permalink
Add pretty debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
binduwavell committed Oct 29, 2018
1 parent 3bbe3a0 commit 04056c8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 86 deletions.
93 changes: 10 additions & 83 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"flat": "^4.1.0",
"fs": "0.0.1-security",
"inquirer": "^6.2.0",
"prettyjson": "^1.2.1",
"shelljs": "^0.8.2",
"source-map-loader": "^0.2.4",
"ts-loader": "^5.2.2",
Expand Down
15 changes: 12 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import * as fsAutocomplete from 'vorpal-autocomplete-fs';
import * as flatten from "flat";
import * as _cliProgress from "cli-progress";
import chalk = require('chalk');
import AsciiTable = require("ascii-table");
import AsciiTable = require("ascii-table");
import prettyjson = require('prettyjson');

let parseNodeRef = (nodeRef?: string) => {
return nodeRef;
Expand Down Expand Up @@ -145,9 +146,17 @@ vorpal.command('list people', "Lists all users in system.")

vorpal
.command('debug', 'Debug current connection information.')
.option('-p, --pretty', "Format information to be more human readable.")
.types({
boolean: ['p', 'pretty']
})
.action(function (args, callback) {
this.log('debug: ');
this.log(JSON.stringify(alfrescoJsApi));
if (args.options.pretty) {
this.log(prettyjson.render(alfrescoJsApi));
} else {
this.log('debug: ');
this.log(JSON.stringify(alfrescoJsApi));
}
callback();
});

Expand Down

0 comments on commit 04056c8

Please sign in to comment.