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: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup