Command Line Arguments
Hi-- I've seen this come up several times (and it's in "Deep") but I can't seem to actually make Command Line Arguments work. If I do (this is under Windows, but I set up a fresh Linux just to ensure it wasn't a Windows quirk): Pharo.exe Pharo4.0image 99 Pharo comes up with "Command line handler failed". I see in the stack trace that the "99" comes in as an orderedCollection. And if I do: Pharo.exe Pharo4.0image 99 100 101 I get an orderedCollection with 99, 100 and 101, which is what I'd expect. In fact, it would be perfect if it didn't crash and put those values somewhere, like, I don't know, CommandLineArguments' arguments variable? =) So, I'm obviously not getting something here. How do I make simple parm passing work? Also, I note that: Pharo.exe 99 100 101 Brings up Pharo with the default image but swallows the 99, which seems odd. I'm guessing that it looks for a 99.image and not finding it, ignores the parameter and loads the default image. But it'd be smarter at that point to put the 99 back, I think. ===Blake===
there should be a handler name in there. Like in pharo-ui Pharo.image st somefile.st st is the handler. as is eval or config or your own. Check subclasses of CommandLineHandler including class side. Phil On Apr 27, 2016 6:50 PM, "blake watson" <dsblakewatson@gmail.com> wrote:
Hi--
I've seen this come up several times (and it's in "Deep") but I can't seem to actually make Command Line Arguments work.
If I do (this is under Windows, but I set up a fresh Linux just to ensure it wasn't a Windows quirk):
Pharo.exe Pharo4.0image 99
Pharo comes up with "Command line handler failed". I see in the stack trace that the "99" comes in as an orderedCollection. And if I do:
Pharo.exe Pharo4.0image 99 100 101
I get an orderedCollection with 99, 100 and 101, which is what I'd expect. In fact, it would be perfect if it didn't crash and put those values somewhere, like, I don't know, CommandLineArguments' arguments variable? =)
So, I'm obviously not getting something here. How do I make simple parm passing work?
Also, I note that:
Pharo.exe 99 100 101
Brings up Pharo with the default image but swallows the 99, which seems odd. I'm guessing that it looks for a 99.image and not finding it, ignores the parameter and loads the default image. But it'd be smarter at that point to put the 99 back, I think.
===Blake===
pharo Pharo.image --list will give you the command lines available, then pharo Pharo.image aCommand --help will give you the subcommands possible in your case, you want something like this: pharo Pharo.image eval â99 factorialâ cheers, Esteban ps: this questions are more for the pharo-users list than pharo-dev :)
On 27 Apr 2016, at 20:04, philippe.back@highoctane.be <philippe.back@gmail.com> wrote:
there should be a handler name in there.
Like in pharo-ui Pharo.image st somefile.st <http://somefile.st/> st is the handler. as is eval or config or your own.
Check subclasses of CommandLineHandler including class side.
Phil
On Apr 27, 2016 6:50 PM, "blake watson" <dsblakewatson@gmail.com <mailto:dsblakewatson@gmail.com>> wrote: Hi--
I've seen this come up several times (and it's in "Deep") but I can't seem to actually make Command Line Arguments work.
If I do (this is under Windows, but I set up a fresh Linux just to ensure it wasn't a Windows quirk):
Pharo.exe Pharo4.0image 99
Pharo comes up with "Command line handler failed". I see in the stack trace that the "99" comes in as an orderedCollection. And if I do:
Pharo.exe Pharo4.0image 99 100 101
I get an orderedCollection with 99, 100 and 101, which is what I'd expect. In fact, it would be perfect if it didn't crash and put those values somewhere, like, I don't know, CommandLineArguments' arguments variable? =)
So, I'm obviously not getting something here. How do I make simple parm passing work?
Also, I note that:
Pharo.exe 99 100 101
Brings up Pharo with the default image but swallows the 99, which seems odd. I'm guessing that it looks for a 99.image and not finding it, ignores the parameter and loads the default image. But it'd be smarter at that point to put the 99 back, I think.
===Blake===
Phil, Estevan-- I think part of what confused me is that there's no printout at all under Windows, so Pharo opens and says "Yep, that worked." But there's no actual output anywhere.
ps: this questions are more for the pharo-users list than pharo-dev :)
Duly noted. For some reason, I thought that was defunct. (But I had just unsubscribed somehow.) On Wed, Apr 27, 2016 at 11:53 AM, Esteban Lorenzano <estebanlm@gmail.com> wrote:
pharo Pharo.image --list
will give you the command lines available, then
pharo Pharo.image aCommand --help
will give you the subcommands possible
in your case, you want something like this:
pharo Pharo.image eval â99 factorialâ
cheers, Esteban
ps: this questions are more for the pharo-users list than pharo-dev :)
On 27 Apr 2016, at 20:04, philippe.back@highoctane.be < philippe.back@gmail.com> wrote:
there should be a handler name in there.
Like in pharo-ui Pharo.image st somefile.st
st is the handler. as is eval or config or your own.
Check subclasses of CommandLineHandler including class side.
Phil On Apr 27, 2016 6:50 PM, "blake watson" <dsblakewatson@gmail.com> wrote:
Hi--
I've seen this come up several times (and it's in "Deep") but I can't seem to actually make Command Line Arguments work.
If I do (this is under Windows, but I set up a fresh Linux just to ensure it wasn't a Windows quirk):
Pharo.exe Pharo4.0image 99
Pharo comes up with "Command line handler failed". I see in the stack trace that the "99" comes in as an orderedCollection. And if I do:
Pharo.exe Pharo4.0image 99 100 101
I get an orderedCollection with 99, 100 and 101, which is what I'd expect. In fact, it would be perfect if it didn't crash and put those values somewhere, like, I don't know, CommandLineArguments' arguments variable? =)
So, I'm obviously not getting something here. How do I make simple parm passing work?
Also, I note that:
Pharo.exe 99 100 101
Brings up Pharo with the default image but swallows the 99, which seems odd. I'm guessing that it looks for a 99.image and not finding it, ignores the parameter and loads the default image. But it'd be smarter at that point to put the 99 back, I think.
===Blake===
Le 27/04/2016 22:51, blake watson a écrit :
Phil, Estevan--
I think part of what confused me is that there's no printout at all under Windows, so Pharo opens and says "Yep, that worked." But there's no actual output anywhere.
Hi, This is because stdin/stdout/stderr stream does not work on windows :( There might be a "stderr" file close to your image with the output.
ps: this questions are more for the pharo-users list than pharo-dev :)
Duly noted. For some reason, I thought that was defunct. (But I had just unsubscribed somehow.)
-- Cyril Ferlicot http://www.synectique.eu 165 Avenue Bretagne Lille 59000 France
participants (4)
-
blake watson -
Cyril Ferlicot D. -
Esteban Lorenzano -
philippe.back@highoctane.be