[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Distinguish between octave an non-octave argv?
From: |
Martin Helm |
Subject: |
Re: Distinguish between octave an non-octave argv? |
Date: |
Tue, 17 May 2011 16:54:38 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Am Dienstag, 17. Mai 2011, 16:34:29 schrieb Judd Storrs:
> Hi,
>
> I'm trying to separate octave vs non-octave command line parameters but it
> seems more difficult than necessary, so I could be missing something. For
> example, consider this simple script (./test-script):
>
> ./test-script.m:
> #!/usr/bin/octave -qf
> argv
>
> then:
>
> $ ./test-script.m test
> ans =
> {
> [1,1] = test
> }
>
> which I expect. But things are different when no parameters are provided:
>
> $ ./test-script.m
> ans =
> {
> [1,1] = -qf
> [2,1] = ./test-script.m
> }
>
> So, a simple test that argv() is zero doesn't work. I'm inclined to see
> this as a bug, but I wanted to make sure I'm not missing something before
> I start working on a patch. Is there some other easy way to test that no
> command line parameters were given to the script?
>
>
> --judd
Which version do you use? The example gives here with 3.4.0
./test-script.m
ans = {}(0x0)
./test-script.m test
ans =
{
[1,1] = test
}