Hi Jeff,

some addition on your explanation of arguments ...

If Rebol is started without a script, it normally only accepts
the rebol arguments, and these are not accessible for a script:

rebol -q
REBOL/Core 2.5.0.4.2 23-Mar-2001
Copyright 2000-2001 REBOL Technologies.  All rights reserved.
>> probe system/options/args
none
== none
>> 

rebol help
REBOL/Core 2.5.0.4.2
Copyright 1997-2001 REBOL Technologies
...
>> probe system/options/args
none
== none
>> 

But you can get arguments into your user.r, by using -- before
your args:

rebol -- -q
REBOL/Core 2.5.0.4.2
Copyright 1997-2001 REBOL Technologies
...
>> probe system/options/args
["-q"]
== ["-q"]
>> 


I just thought someone might find this handy.


kind regards,

Ingo


Once upon a time [EMAIL PROTECTED] spoketh thus:
> 
>  Andrew Martin passed along someone's question: 
> 
> > > The question is -  How does one  pass  a dynamic list  of
> > > arguments  to a REBOL script  invoked from:  a) the rebol
> > > command line b) a DOS batch file c) a Unix shell script?
> 
>   With Core 2.5 you can take any number of args from the
>   command line which are split into separate arguments found
>   in system/options/args:
> 
>   Try this script (unix version):
> 
> ;-------------------------------
> 
> #!/path/to/rebol 
> REBOL [
>    Title: "Args checker"
> ]
> foreach obj [options script][
>     print [obj #== mold get in system/:obj 'args]
> ] quit
> 
> ;-------------------------------
> 
> Call the script rargs, put it in your path, make it executable
> and then try stuff like:
> 
> rargs 1 2 3
> rargs "1 2" 3
> 
> etc..
> 
> You should see that system/options/args winds up being set to
> a block containing each argument as a separate string.  Then
> if you want to have fun you can use PARSE on the block and set
> various options in a pretty simple way:
> 
> rest: copy []
> parse system/options/args [
>     some [
>         "-q" (quiet: true)      |
>         "-v" (verbose: yes)     |
>         "-x" (experimental: on) |
>         set other string! (append rest other)
>     ]
> ]
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to