<div dir="ltr"><div class="gmail_extra">Feel free to grab pieces from here, if you find it useful: <a href="https://patchwork.openembedded.org/patch/89543/">https://patchwork.openembedded.org/patch/89543/</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">I based it on the same logic used by git to determine whether the user had a pager set already and whether or not the output was going to the terminal or being piped to another process.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The feedback I got was that the functionality wasn&#39;t needed and users could just pipe it to less if they wanted a pager: <a href="http://lists.openembedded.org/pipermail/bitbake-devel/2015-March/005545.html">http://lists.openembedded.org/pipermail/bitbake-devel/2015-March/005545.html</a></div><div class="gmail_extra"><br>Regards,<br>Rob</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 26, 2017 at 4:48 PM, Diana Thayer <span dir="ltr">&lt;<a href="mailto:garbados@gmail.com" target="_blank">garbados@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you for the feedback!<div><br></div><div>I&#39;ve added lines to check $OE_PAGER and $PAGER, such that `PAGER=cat bitbake -e` effectively disables pagination.</div><div><br></div><div>Regarding the option &#39;--paginate&#39;, would it capture output from whatever command has run? I&#39;m not sure how to capture stdout at such a scope.</div><div><br></div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 20, 2017 at 6:39 AM, Peter Kjellerstedt <span dir="ltr">&lt;<a href="mailto:peter.kjellerstedt@axis.com" target="_blank">peter.kjellerstedt@axis.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="SV">
<div class="gmail-m_-1063956160762219362m_-2171653402677448379WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(148,54,52)">Basically, this change needs to be aware of the destination for the output. If it is a tty, then it is fine to output
 to a viewer such as less, but otherwise it should go to stdout as before. This should of course not be hardcoded, but use environment variables, e.g., $OE_PAGER || $PAGER || less (inspired by git_pager() in the git source). You should also not expect that
 everyone wants the options you have used for less. Looking again at how git handles this, they use “LESS=FRX &lt;command&gt;” if the $LESS environment variable is not set, and does not modify it if it is set. You also want to add options such as --paginate and --no-pager
 (yet again inspired by git) to bitbake.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(148,54,52)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(148,54,52)">All in all, look at and be inspired by how git handles pagers, they have this pretty well covered.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(148,54,52)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(148,54,52)">//Peter<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(148,54,52)"><u></u> <u></u></span></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> <a href="mailto:bitbake-devel-bounces@lists.openembedded.org" target="_blank">bitbake-devel-bounces@lists.op<wbr>enembedded.org</a> [mailto:<a href="mailto:bitbake-devel-bounces@lists.openembedded.org" target="_blank">bitbake-devel-bounces@<wbr>lists.openembedded.org</a>]
<b>On Behalf Of </b>Burton, Ross<br>
<b>Sent:</b> den 20 juni 2017 12:06<br>
<b>To:</b> Diana Thayer &lt;<a href="mailto:garbados@gmail.com" target="_blank">garbados@gmail.com</a>&gt;<br>
<b>Cc:</b> bitbake-devel &lt;<a href="mailto:bitbake-devel@lists.openembedded.org" target="_blank">bitbake-devel@lists.openembed<wbr>ded.org</a>&gt;<br>
<b>Subject:</b> Re: [bitbake-devel] [PATCH] bitbake : Paginate &#39;bitbake -e&#39; using less.<u></u><u></u></span></p>
</div>
</div><div><div class="gmail-m_-1063956160762219362h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 20 June 2017 at 05:54, Diana Thayer &lt;<a href="mailto:garbados@gmail.com" target="_blank">garbados@gmail.com</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div id="gmail-m_-1063956160762219362m_-2171653402677448379:9ou">
<p class="MsoNormal">+        pager = subprocess.Popen([&#39;less&#39;, &#39;-F&#39;, &#39;-R&#39;, &#39;-S&#39;, &#39;-X&#39;, &#39;-K&#39;],<br>
+                                 stdin=subprocess.PIPE,<br>
+                                 stdout=sys.stdout,<br>
+                                 universal_newlines=True)<u></u><u></u></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br>
What if I&#39;m piping bitbake -e though grep or into a file already?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Ross<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br></div>
</div></div><br>--<br>
______________________________<wbr>_________________<br>
bitbake-devel mailing list<br>
<a href="mailto:bitbake-devel@lists.openembedded.org">bitbake-devel@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/bitbake-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/bitbake-devel</a><br>
<br></blockquote></div><br></div></div>