help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: getopt


From: Juergen Rose
Subject: RE: getopt
Date: Sat, 10 Oct 2009 23:16:25 +0200

Am Samstag, den 10.10.2009, 10:48 +0000 schrieb address@hidden:
> did you see   varargin?
> 
> Doug
> 
> > Subject: getopt
> > From: address@hidden
> > To: address@hidden
> > Date: Sat, 10 Oct 2009 19:55:35 +0200
> > 
> > Hi,
> > 
> > I am looking for a possibility to evaluate the arguments passed to a
> > octave script similar to getopt[s] in bash or Getopt::Std in perl.
> > 
> > Any hints are appreciated.

Hi Doug,

I don't understand, what 'varargin' has to do with 'getopt'.

octave:1> help varargin

 -- Keyword: varargin
     Pass an arbitrary number of arguments into a function.

     See also: varargout, nargin, nargout

I need a function, which I can use to parse arg_list = argv() and which
can distinguish between allowed and not allowed options, and between
options with and without additional parameter.
I.e., I look for something like in Perl:

use Getopt::Std;
my $opts="dhS:o:N:n:";
my $options={};
getopts($opts,$options);
if (defined $options->{d}) {$DBG_LVL=$options->{d};}
if (defined $options->{h}) {usage();   exit 0;}
if (defined $options->{S}) {$Seed=$options->{S};}
..

Regards Juergen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]