diff --git a/docs/using-cli.md b/docs/using-cli.md index 0f369a9a..479cf7f8 100644 --- a/docs/using-cli.md +++ b/docs/using-cli.md @@ -170,6 +170,10 @@ displayed. The displayed help shows information about which Python component your command corresponds to, as well as usage information for how to extend that command. +The environment variable, `FIRE_PAGER`, sets the default pager for help text +to the preferred program. For example, set `FIRE_PAGER=-` to print help text +on standard out. + ### `--trace`: Getting a Fire trace diff --git a/fire/console/console_io.py b/fire/console/console_io.py index 3d3b9f81..c1f5c7fc 100644 --- a/fire/console/console_io.py +++ b/fire/console/console_io.py @@ -83,6 +83,10 @@ def More(contents, out, prompt=None, check_pager=True): return if check_pager: pager = encoding.GetEncodedValue(os.environ, 'PAGER', None) + fire_pager = encoding.GetEncodedValue(os.environ, 'FIRE_PAGER', None) + if fire_pager: + # FIRE_PAGER takes precedence to PAGER + pager = fire_pager if pager == '-': # Use the fallback Pager. pager = None