helpGNU source-highlight - Support: sr #106347, Does not default to stdout,...


sr #106347: Does not default to stdout, despite --help text

Submitted by:  None
Submitted on:  Sun 20 Apr 2008 06:20:50 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 01 Jun 2019 08:18:17 PM UTC, comment #2: 

I think this is fixed now

Tom Tromey <tromey>
Project Administrator
Fri 02 Sep 2011 09:35:58 AM UTC, comment #1: 

Sorry for the delay;

indeed the behavior is correct, but it is not so clear from the --help output (it is better documented in the manual,  Now it should be clear in the --help output:

Usage: 1. source-highlight [OPTIONS]... < input_file > output_file
       2. source-highlight [OPTIONS]... -i input_file -o output_file
       3. source-highlight [OPTIONS]... [FILES]...

  -h, --help                    Print help and exit
      --detailed-help           Print help, including all details and hidden
                                  options, and exit
  -V, --version                 Print version and exit
  -i, --input=filename          input file. default std input
  -o, --output=filename         output file. default std output (when
                                  the third invocation form is used). If STDOUT is
                                  specified, the output is directed to standard

you can simply specify some files at the command line and also use regular
expressions (for instance *.java).  In this case the name for the output files
will be formed using the name of the source file with a .<ext> appended, where
<ext> is the extension chosen according to the output format specified (for
instance .html).

Lorenzo Bettini <bettini>
Project Administrator
Sun 20 Apr 2008 06:20:50 PM UTC, original submission:  

Repost from See that webpage for details.

The --help text says that the default is to send output to stdout, but
the default seems to be to create a new file with .html extension:

 $ source-highlight --help | grep -A2 'output=filename'
   -o, --output=filename         output file. default std output. If STDOUT is
                                   specified, the output is directed to standard
 $ ls
 $ source-highlight --src-lang perl hello
 Processed hello
 $ ls
 hello  hello.html

Specifying --output STDOUT does work:

 $ source-highlight --src-lang perl --output STDOUT hello
 <!-- Generator: GNU source-highlight 2.4
 by Lorenzo Bettini -->
 <pre><tt><i><font color="#9A1900">#!/usr/bin/perl</font></i>

 <b><font color="#0000FF">use</font></b> strict<font color="#990000">;</font>
 <b><font color="#0000FF">use</font></b> warnings<font color="#990000">;</font>

 <b><font color="#0000FF">print</font></b> <font color="#FF0000">"Hello
world\n"</font><font color="#990000">;</font>
 Processed hello

So it looks like it is just the default (or, maybe, but I hope not, the --help text) that is wrong.

// Adam Sj√łgren <>

Kresten Kjeldgaard <> has also provided a patch to make it behave as the documentation tells.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by tromey (Posted a comment)
  • -email is unavailable- added by bettini (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-01 tromey Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5