From dceffd7b258c3a1799c3b5b9f2172d88e679c469 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Tue, 2 Jul 2013 16:42:22 -0700 Subject: [PATCH] [issue #96] Fix `bunyan` to default to paging by default in node 0.10.0. --- CHANGES.md | 4 +++- bin/bunyan | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 92c905f..66cf73d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,9 @@ Known issues: ## bunyan 0.21.4 (not yet released) -(nothing yet) +- [issue #96] Fix `bunyan` to default to paging (with `less`) by default in + node 0.10.0. The intention has always been to default to paging for node + >=0.8. ## bunyan 0.21.3 diff --git a/bin/bunyan b/bin/bunyan index fdf0d7b..3abfa9e 100755 --- a/bin/bunyan +++ b/bin/bunyan @@ -8,6 +8,7 @@ var VERSION = '0.21.4'; +var p = console.log; var util = require('util'); var pathlib = require('path'); var vm = require('vm'); @@ -165,7 +166,6 @@ function objCopy(obj) { function printHelp() { /* BEGIN JSSTYLED */ - var p = console.log; p('Usage:'); p(' bunyan [OPTIONS] [FILE ...]'); p(' ... | bunyan [OPTIONS]'); @@ -1399,7 +1399,7 @@ function main(argv) { !opts.pids && // Don't page if following process output. opts.args.length > 0 && // Don't page if no file args to process. process.platform !== 'win32' && - nodeVer >= [0, 8, 0] && + (nodeVer[0] > 0 || nodeVer[1] >= 8) && (opts.paginate === true || (opts.paginate !== false && (!process.env.BUNYAN_NO_PAGER ||