On 30/01/13 12:56, Allan McRae wrote:
> On 30/01/13 12:38, Andrew Gregory wrote:
>> Signed-off-by: Andrew Gregory <[email protected]>
>> ---
>>
>> I think I'm alone in wanting to remove the isatty check, but we can at least
>> document it.
>>
> 
> For the record, this is the old discussion, which I am not entirely
> convinced came to a conclusion.  Is there some standard - not
> necessarily a real standard but perhaps in the GNU coding conventions -
> that we can use to justify either behaviour.
> 
> [1] https://patchwork.archlinux.org/patch/720/

OK...  I have done some reading and here is my decision!

Keep the !isatty check.  It makes little sense to read packages from a
terminal to me.  But there is two things that need done:

1) Documentation as below.

2) Fix the error message:

> pacman -S -
error: target not found: -

"-" is not a valid pkgname so we can do better in this situation.   How
about something like:

error: "-" specified - stdin can not be read from a terminal

Better suggestions welcome!

> 
>>  doc/pacman.8.txt | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
>> index de28b9c..358d506 100644
>> --- a/doc/pacman.8.txt
>> +++ b/doc/pacman.8.txt
>> @@ -27,8 +27,8 @@ front ends to be written (for instance, a GUI front end).
>>  Invoking pacman involves specifying an operation with any potential options 
>> and
>>  targets to operate on. A 'target' is usually a package name, filename, URL, 
>> or
>>  a search string. Targets can be provided as command line arguments.
>> -Additionally, if a single dash (-) is passed as an argument, targets will be
>> -read from stdin.
>> +Additionally, if stdin is not from a terminal and a single dash (-) is 
>> passed
>> +as an argument, targets will be read from stdin.
>>  
>>  
>>  Operations
>>
> 
> 
> 
> 


Reply via email to