1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Documentation tweak for TYPE

Discussion in 'Support' started by p.f.moore, Jul 16, 2008.

  1. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    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. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    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
     
  3. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    1
    On 16/07/2008, Steve Fábián <> wrote:

    [...]

    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".


    I see no problem with having a huge quantity of help for a program
    with a huge quantity of functionality :-)

    Paul.
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,299
    Likes Received:
    39
  5. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    1
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    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
     

Share This Page