Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
f998e657
Commit
f998e657
authored
Dec 16, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9809 from mscherer/fix_9695
Make sure ansible-doc work when stdin is not a tty
parents
828adbf7
caefc20f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
bin/ansible-doc
+5
-2
No files found.
bin/ansible-doc
View file @
f998e657
...
...
@@ -71,7 +71,7 @@ def pager(text):
pager_print
(
text
)
else
:
pager_pipe
(
text
,
os
.
environ
[
'PAGER'
])
elif
hasattr
(
os
,
'system'
)
and
os
.
system
(
'(less) 2> /dev/null'
)
==
0
:
elif
subprocess
.
call
(
'(less --version) 2> /dev/null'
,
shell
=
True
)
==
0
:
pager_pipe
(
text
,
'less'
)
else
:
pager_print
(
text
)
...
...
@@ -165,7 +165,10 @@ def get_snippet_text(doc):
return
"
\n
"
.
join
(
text
)
def
get_module_list_text
(
module_list
):
columns
=
max
(
60
,
int
(
os
.
popen
(
'stty size'
,
'r'
)
.
read
()
.
split
()[
1
]))
tty_size
=
0
if
os
.
isatty
(
0
):
tty_size
=
int
(
os
.
popen
(
'stty size'
,
'r'
)
.
read
()
.
split
()[
1
])
columns
=
max
(
60
,
tty_size
)
displace
=
max
(
len
(
x
)
for
x
in
module_list
)
linelimit
=
columns
-
displace
-
5
text
=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment