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

 
 

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

Submitter:  None
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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

I think this is fixed now

Tom Tromey <tromey>
Group 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, http://www.gnu.org/software/src-highlite/source-highlight.html#Simple-Usage).  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
                                  output

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>
Group administrator
Sun 20 Apr 2008 06:20:50 PM UTC, original submission:  

Repost from http://bugs.debian.org/476863 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
                                   output
 $ ls
 hello
 $ 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
 http://www.lorenzobettini.it
 http://www.gnu.org/software/src-highlite -->
 <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>
 </tt></pre>
 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 <asjo@koldfront.dk>

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

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    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.13-3230.
    Corresponding source code