Advanced

Options Parsing and Keywords

Posted by jayrfink on · Post a comment
Systhread.net; By Jason R Fink
Mail this story
Print this story

The traditional Unix utility uses options and arguments to parse command line parms that dictate how the utility should work. Long options is one way to make a utility's usage somewhat natural; for example: util --version. Some utilities use keywords and command/sub-command syntax. It is possible to combine the two without causing too much confusion.

Most system oriented scripters and programmers tend to rely upon the classic Unix model of options and/or arguments; conversely, many programs and scripts use a subcommand structure that is similar to language processing (or lexical checks). Consider that APIs generally use a lexical style interface - in a sense the natrual language idea makes sense if the script or program is going to be called by another program.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments

No comments yet. Be the first.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post