Documentation tweak for TYPE

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 30, 2008
122
1
#1
The documentation for TYPE starts:

TYPE [/A:[[-][+]rhsadecijopt] /I"text" /L /P] [@file] file...

However, TYPE actually works with no file parameters, when it reads
from STDIN. This is useful when you have an external command that uses
ANSI colour sequences, and you want to display that colour - you can
pipe into TYPE. For example,

ls --color | TYPE

Just putting [] round the file... part of the parameter list (plus a
note in the text saying "Without a file list, TYPE displays the
contents of STDIN") should be enough.

Paul.
 
#2
p.f.moore wrote:
| The documentation for TYPE starts:
|
| TYPE [/A:[[-][+]rhsadecijopt] /I"text" /L /P] [@file] file...
|
| However, TYPE actually works with no file parameters, when it reads
| from STDIN. This is useful when you have an external command that uses
| ANSI colour sequences, and you want to display that colour - you can
| pipe into TYPE. For example,
|
| ls --color | TYPE
|
| Just putting [] round the file... part of the parameter list (plus a
| note in the text saying "Without a file list, TYPE displays the
| contents of STDIN") should be enough.

Sorry, TYPE does not work from STDIN, except from redirected input, be it
from a pipe, as in your case, or from redirected input, e.g, "TYPE <
file.txt" (which behaves identically to "TYPE file.txt"). This, in fact,
ought to be mentioned in help otpic "type.htm". We really ought to have a
gigabyte help file!

Try TYPE <enter> - you get an error message.
--
Steve
 
May 30, 2008
122
1
#3
On 16/07/2008, Steve Fábián <> wrote:

> Sorry, TYPE does not work from STDIN, except from redirected input
[...]

> Try TYPE <enter> - you get an error message.
I never thought of that - TYPE from non-redirected stdin is pretty
useless. But TYPE from a pipe (to translate ANSI codes) has a definite
use. Actually, now I look, I see that this usage is documented under
"ANSI Support".


> We really ought to have a gigabyte help file!
I see no problem with having a huge quantity of help for a program
with a huge quantity of functionality :-)

Paul.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,376
39
Albuquerque, NM
prospero.unm.edu
#4
#6
p.f.moore wrote:
| On 16/07/2008, Steve Fábián <> wrote:
| ---Quote---
|| We really ought to have a gigabyte help file!
| ---End Quote---
| I see no problem with having a huge quantity of help for a program
| with a huge quantity of functionality :-)

Documentation costs much more than software development. Such a file could
easily double the price you pay for the product.
--
Steve