mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-05 13:44:24 -07:00
This commit is contained in:
parent
1df924e1d5
commit
eefe359d6b
1 changed files with 6 additions and 3 deletions
|
@ -479,10 +479,13 @@ class CLI(object):
|
||||||
display.display(text)
|
display.display(text)
|
||||||
else:
|
else:
|
||||||
self.pager_pipe(text, os.environ['PAGER'])
|
self.pager_pipe(text, os.environ['PAGER'])
|
||||||
elif subprocess.call('(less --version) &> /dev/null', shell = True) == 0:
|
|
||||||
self.pager_pipe(text, 'less')
|
|
||||||
else:
|
else:
|
||||||
display.display(text)
|
p = subprocess.Popen('less --version', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
p.communicate()
|
||||||
|
if p.returncode == 0:
|
||||||
|
self.pager_pipe(text, 'less')
|
||||||
|
else:
|
||||||
|
display.display(text)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def pager_pipe(text, cmd):
|
def pager_pipe(text, cmd):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue