aboutsummaryrefslogtreecommitdiffstats
path: root/be
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-07 07:36:14 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-07 07:36:14 -0500
commitb7901b5054a4bf51798098cd3aaa3eb33bb4ee5e (patch)
tree3a1a746945d2fcad3cf67abd5b0b136ede81588f /be
parentfdf9925ffaada614544d1b2d3ccecb42f1549acb (diff)
parenta2562bc912e33fb3748be9d01771c9ae0ed6010f (diff)
downloadbugseverywhere-b7901b5054a4bf51798098cd3aaa3eb33bb4ee5e.tar.gz
Added libbe.pager and --paginate/--no-pager options to be.
Diffstat (limited to 'be')
-rwxr-xr-xbe16
1 files changed, 15 insertions, 1 deletions
diff --git a/be b/be
index 8a594cf..f026c05 100755
--- a/be
+++ b/be
@@ -22,7 +22,7 @@
import os
import sys
-from libbe import cmdutil, version
+from libbe import cmdutil, version, pager
__doc__ = cmdutil.help()
@@ -36,6 +36,13 @@ parser.add_option("--verbose-version", action="store_true", dest="verbose_versio
help="Print verbose version information and exit.")
parser.add_option("-d", "--dir", dest="dir", metavar="DIR", default=".",
help="Run this command on the repository in DIR instead of the current directory.")
+parser.add_option("-p", "--paginate", dest="paginate", default=False,
+ action='store_true',
+ help="Pipe all output into less (or if set, $PAGER).")
+parser.add_option("--no-pager", dest="no_pager", default=False,
+ action='store_true',
+ help="Do not pipe git output into a pager.")
+
try:
options,args = parser.parse_args()
@@ -57,6 +64,13 @@ if options.version == True or options.verbose_version == True:
print version.version(verbose=options.verbose_version)
sys.exit(0)
+paginate = 'auto'
+if options.paginate == True:
+ paginate = 'always'
+if options.no_pager== True:
+ paginate = 'never'
+pager.run_pager(paginate)
+
try:
if len(args) == 0:
raise cmdutil.UsageError, "must supply a command"