darcs

Issue 610 when to use a $PAGER

Title when to use a $PAGER
Priority wishlist Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, ertai, kowey, markstos, salty-horse, thorkilnaur, tommy, wferi
Assigned To
Topics

Created on 2008-01-24.02:20:29 by markstos, last changed 2009-10-24.00:05:42 by admin.

Messages
msg2708 (view) Author: markstos Date: 2008-01-24.02:20:27
When I do "darcs record -h", the most basic and fundamental details about how it
works immediately scroll off the screen, and I instead see the "Advanced
options" which is far less likely to be what I need, and is generally the same
for all the commands. 

I would suggest that with --help, the last line is just: 

"Help for advanced options is available through --help-advanced"

Running "--help-advanced" would behave as --help does now, showing the regular
and advanced help. 

Besides the scrolling issue, I think provider shorter, more relevant help by
default will increase the impression that darcs is simple and easy to use.
msg2718 (view) Author: ertai Date: 2008-01-24.09:01:12
Excerpts from bugs's message of Thu Jan 24 02:20:30 UTC 2008:
> 
> New submission from Mark Stosberg <mark@summersault.com>:
> 
> When I do "darcs record -h", the most basic and fundamental details about how it
> works immediately scroll off the screen, and I instead see the "Advanced
> options" which is far less likely to be what I need, and is generally the same
> for all the commands. 
> 
> I would suggest that with --help, the last line is just: 
> 
> "Help for advanced options is available through --help-advanced"
> 
> Running "--help-advanced" would behave as --help does now, showing the regular
> and advanced help. 
> 
> Besides the scrolling issue, I think provider shorter, more relevant help by
> default will increase the impression that darcs is simple and easy to use.

What about automatically launching a pager ($PAGER) when the output is a tty?

Note: That's git default
msg2721 (view) Author: markstos Date: 2008-01-24.15:13:20
> What about automatically launching a pager ($PAGER) when the output is a tty?

That would help because it would leave the basic help visible at the top 
of the screen. And I suppose I could quit the pager before scrolling 
down to view the advanced text.

There definitely other uses of darcs where I wish that was the default. 
For example, on a project with any history, you almost always want

darcs changes | $PAGER

not just "darcs changes" anyway.

   Mark
msg2749 (view) Author: droundy Date: 2008-01-25.19:25:15
On Thu, Jan 24, 2008 at 09:56:18AM +0100, Nicolas Pouillard wrote:
> What about automatically launching a pager ($PAGER) when the output is a tty?
> 
> Note: That's git default

I think this is probably the better option.
-- 
David Roundy
Department of Physics
Oregon State University
msg2776 (view) Author: wferi Date: 2008-01-25.21:58:38
David Roundy <droundy@darcs.net> writes:

> On Thu, Jan 24, 2008 at 09:56:18AM +0100, Nicolas Pouillard wrote:
>> What about automatically launching a pager ($PAGER) when the output is a tty?
>> 
>> Note: That's git default
>
> I think this is probably the better option.

It would be especially nice if the pager preserved coloring of the
output.  Is there a way to get darcs1 output escape sequences when
writing to a pipe?  Er, I could as well have a look...
-- 
Thanks,
Feri.
msg2779 (view) Author: markstos Date: 2008-01-25.22:23:19
Wagner Ferenc wrote:
> 
> David Roundy <droundy@darcs.net> writes:
> 
>> On Thu, Jan 24, 2008 at 09:56:18AM +0100, Nicolas Pouillard wrote:
>>> What about automatically launching a pager ($PAGER) when the output is a tty?
>>>
>>> Note: That's git default
>> I think this is probably the better option.
> 
> It would be especially nice if the pager preserved coloring of the
> output.  Is there a way to get darcs1 output escape sequences when
> writing to a pipe?  Er, I could as well have a look...

I think what you are getting at might be how the defaults are set up for 
the Perl-based 'ack' program:

If the output is a tty, color is on by default. However, if output is a 
pipe, color is off by default, since other programs tend to expect plain 
text.

Related: I believe "less" doesn't handle color escape codes by default. 
You have to invoke it with "-R" for that.

   Mark
msg2782 (view) Author: markstos Date: 2008-01-25.22:33:20
This well-commented perl function "is_interactive" may be of interest 
when writing code that decides when to show color and use a $PAGER by 
default and when to not.  It is what the 'ack' utility uses:

http://search.cpan.org/src/DCONWAY/IO-Interactive-v0.0.3/lib/IO/Interactive.pm

( ack is a programmer-friendly alternative to "grep" ).

   Mark
msg3221 (view) Author: salty-horse Date: 2008-02-07.21:21:37
While the exact use-cases of the pager are still discussed, I noticed that
"darcs help <command>" launches a pager, but "darcs <command> --help" doesn't.
msg4080 (view) Author: droundy Date: 2008-03-28.20:32:03
We now use pager for darcs commmand --help.  I'm closing this bug, and folks who
like could open a fresh bug with a specific request.
History
Date User Action Args
2008-01-24 02:20:29markstoscreate
2008-01-24 09:01:14ertaisetstatus: unread -> unknown
nosy: + darcs-devel, ertai
messages: + msg2718
2008-01-24 15:13:21markstossetnosy: droundy, tommy, beschmi, kowey, markstos, darcs-devel, ertai
messages: + msg2721
2008-01-25 19:25:17droundysetnosy: droundy, tommy, beschmi, kowey, markstos, darcs-devel, ertai
messages: + msg2749
2008-01-25 21:58:39wferisetnosy: + wferi
messages: + msg2776
2008-01-25 22:23:21markstossetnosy: droundy, tommy, beschmi, kowey, markstos, darcs-devel, ertai, wferi
messages: + msg2779
2008-01-25 22:33:21markstossetnosy: droundy, tommy, beschmi, kowey, markstos, darcs-devel, ertai, wferi
messages: + msg2782
title: wish: hide advanced with --help-advanced -> when to use a $PAGER
2008-02-06 04:29:39markstoslinkissue84 superseder
2008-02-07 21:21:38salty-horsesetnosy: + wferi, salty-horse, - wferi
messages: + msg3221
2008-02-11 01:28:41markstossetstatus: unknown -> has-patch
nosy: droundy, tommy, beschmi, kowey, markstos, darcs-devel, salty-horse, ertai, wferi
2008-03-28 20:32:05droundysetstatus: has-patch -> resolved-in-unstable
nosy: droundy, tommy, beschmi, kowey, markstos, darcs-devel, salty-horse, ertai, wferi
messages: + msg4080
2008-09-04 21:32:04adminsetstatus: resolved-in-unstable -> resolved
nosy: + dagit
2009-08-06 17:52:12adminsetnosy: + jast, Serware, dmitry.kurochkin, zooko, mornfall, simon, thorkilnaur, - droundy, salty-horse, ertai, wferi
2009-08-06 20:55:10adminsetnosy: - beschmi
2009-08-10 22:11:46adminsetnosy: + wferi, ertai, salty-horse, - zooko, jast, Serware, mornfall
2009-08-11 00:05:01adminsetnosy: - dagit
2009-08-25 18:03:38adminsetnosy: - simon
2009-08-27 14:08:18adminsetnosy: tommy, kowey, markstos, darcs-devel, salty-horse, thorkilnaur, ertai, wferi, dmitry.kurochkin
2009-10-23 22:40:43adminsetnosy: + nicolas.pouillard, - ertai
2009-10-24 00:05:42adminsetnosy: + ertai, - nicolas.pouillard