McKown, John wrote:
-----Original Message-----
From: Linux on 390 Port [mailto:linux-...@vm.marist.edu] On
Behalf Of Christian Paro
Sent: Wednesday, December 02, 2009 11:24 AM
To: LINUX-390@VM.MARIST.EDU
Subject: Re: Linux software development question

If this is an application you wrote, why not just have it
write to stdout
and then redirect its output at the shell to wherever you
want to put it. In
other words, instead of:

`app in1 in2 in3 output.file`

you'd have

`app in1 in2 in3 > output.file` (to output to a file named
"output.file")

or

`app in1 in2 in3 1>&2` (to output to stderr)


Good question. I guess because the program is really writing out binary data, not something that 
should be directed to the screen. Which, of course, begs the question: "then why have a way to 
write it to stderr?" I can see writing it to stdout so that you could pipe it into something 
else, without an intermediate "temporary" file.

But my main question was about standard conventions and is there one for using 
stderr in a parm list where a file name is normally used and required. As a - 
is used for either stdin or stdout, whichever applies in the context.

Is there a web site which detail "standard conventions"?

C was originally written for programming on Unix, and since Linux so
resembles Unix, it works well there.

The way popular languages such as C, C++ and Java work just the way
they're expected to do in Linux.

The standard conventions are pretty much what your programming
documentation says to do.

If you want to write binary data to a file, stdout and stderr are poor
choices, some time someone will get a face full on their screen,
possibly making the screen hard to read.

Single hyphens for arguments seems pretty much the Unix way, double
hyphens the GNU way. However, not all programs use hyphens at all, dd
for example.

Assuming I still have your attention, please, where you allow an
argument such as "--pkg" you also accept "--package" because
abbreviations obvious to you might not be so to others, especially those
from very different cultures such as India.

Where you expect "--all-packages" also accept "--all_packages." I have
lots of trouble remembering which separator is used in particular cases.

getopt is an excellent package (once one understands the documentation)
for sorting out the commandline. However, I don't know that it's
available for Java.

Personally, I like commandlines that seem somewhat english with no
special punctuation:
copy file (-|source) to (-|target) by ftp






--

Cheers
John

-- spambait
1aaaa...@coco.merseine.nu  z1aaaa...@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to