LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   seeking guidelines for command line programming (https://www.linuxquestions.org/questions/linux-software-2/seeking-guidelines-for-command-line-programming-4175444682/)

SaintDanBert 01-08-2013 11:46 AM

seeking guidelines for command line programming
 
I'm returning to writing code after years of suit-time and now I need to refresh my knowledge and skills in the executable program, and script as program development world. In recent times, it seems that program command lines have become more widely varied that they used to be.

I'm posting these questions while I continue to research these topics. Please reply with information instead of flame because I have not found your favorite reference material ... yet.

Q1. Isn't there some sort of guideline or standard for what is supposed to appear as command line options?

Q2a. X-windows programs have long use single-dash long options [eg, -display] while non-X programs used double-dash long options [eg, --verbose]. What are the conventions for programs intended to run from the graphical desktop?

Q2b. Does each desktop have its own conventions?

Q3. Are their conventions for using or avoiding environment variables?

Q4. Are there conventions for per-program and per application suite configuration files? I see a wide mix of INI-file and XML formatted configuration sets.


Follow-up:
Q5. Recommendations for a set of options that benefit every program (a) run from the shell, or (b) run from the desktop, and (c) run both ways.

Q6. Recommendations for a set of options more appropriate to system admin utilities and apps instead of end-user apps.


I will update my posting as I find answers so that others may share the fruit. After all, isn't that why we are reading and posting here in the first place?

Thanks in advance,
~~~ 0;-Dan

SaintDanBert 01-08-2013 11:55 AM

I found the following:

GNU 'getopt'
http://www.gnu.org/software/libc/man...g-Options.html

Command Line Options
http://catb.org/~esr/writings/taoup/html/ch10s05.html

Developing a Command Line Utility
http://www.ibm.com/developerworks/li...rary/l-clutil/

The Open Group Base Specifications Issue 6 -- Utility Conventions
http://pubs.opengroup.org/onlinepubs...bd_chap12.html

Follow-up:

Command Line Options
http://www.faqs.org/docs/artu/ch10s05.html

I continue seeking recommendations for a standard set of command-line options for (a) programs run from a shell and used in a terminal window; Are these called "console" apps? and (b) programs used from the desktop that may be launched from the desktop or from a shell.

Thanks in advance,
~~~ 0;-Dan


All times are GMT -5. The time now is 06:23 PM.