Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 27e25d4

Browse files
committed
fix for fsh -v hanging
Fixes #889
1 parent e45d007 commit 27e25d4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/headless.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ rowify._default = ({name}) => ({name:pn(name)})
411411
*
412412
*/
413413
const print = (msg, logger=log, stream=process.stdout, color='reset', ok='ok') => {
414-
if (verbose) {
414+
if (verbose && typeof msg === 'string') {
415415
// user asked for verbose output
416416
return prettyJSON(msg, logger)
417417
}
@@ -618,6 +618,7 @@ const main = (app, mainFunctions) => {
618618
debug('plugins initialized')
619619

620620
if (insufficientArgs()) {
621+
debug('insufficient args, invoking help command')
621622
return eval('help')
622623
}
623624

tests/tests/passes/02/headless.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ describe('Headless mode', function() {
8585
.then(cli.expectOK('ok'))
8686
.catch(common.oops(this)))
8787

88+
it('should show top-level help with fsh -v', () => cli.do('-v')
89+
.then(cli.expectError(1, 'Shell Docs / Getting Started'))
90+
.catch(common.oops(this)))
91+
8892
it('should show top-level help with no arguments', () => cli.do('')
8993
.then(cli.expectError(1, 'Shell Docs / Getting Started'))
9094
.catch(common.oops(this)))

0 commit comments

Comments
 (0)