getopt

From DavinciWiki
Jump to: navigation, search

Description

A nice way to deal with command line options for specific davinci scripts

Arguments and Return Values

Input: A structure (generally called opt) with all of the desired elements.

Output: A structure with the same elements but with some changes reflecting the command line

Usage

Syntax: getopt( $ARGV, opt = VAL)

Examples

Options given on the command line before davinci is started

1% davinci filename="TEST" size=100
loading history
dv>

Now we will set up the structure getopt() needs with default values

dv> opt={ filename="default", size=300, input="myfile.png"}
struct, 3 elements
   filename: "default"
   size: 300
   input: "myfile.png"

Next we will run getopt() and the specified values will be filled in

dv> opt2=getopt($ARGV,opt)
struct, 3 elements
   input: "myfile.png"
   size: "100"
   filename: "TEST"

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Library Changes

Created On: 06-18-2007
Modified On: 01-17-2008

Personal tools