mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-03 23:20:19 -07:00
parent
83703e3137
commit
df2fcecd62
1 changed files with 3 additions and 3 deletions
|
@ -611,10 +611,10 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
''' find reasonable way to display text '''
|
''' find reasonable way to display text '''
|
||||||
# this is a much simpler form of what is in pydoc.py
|
# this is a much simpler form of what is in pydoc.py
|
||||||
if not sys.stdout.isatty():
|
if not sys.stdout.isatty():
|
||||||
display.display(text)
|
display.display(text, screen_only=True)
|
||||||
elif 'PAGER' in os.environ:
|
elif 'PAGER' in os.environ:
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
display.display(text)
|
display.display(text, screen_only=True)
|
||||||
else:
|
else:
|
||||||
self.pager_pipe(text, os.environ['PAGER'])
|
self.pager_pipe(text, os.environ['PAGER'])
|
||||||
else:
|
else:
|
||||||
|
@ -623,7 +623,7 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
if p.returncode == 0:
|
if p.returncode == 0:
|
||||||
self.pager_pipe(text, 'less')
|
self.pager_pipe(text, 'less')
|
||||||
else:
|
else:
|
||||||
display.display(text)
|
display.display(text, screen_only=True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def pager_pipe(text, cmd):
|
def pager_pipe(text, cmd):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue