Reply to topic  [ 2 posts ] 
Feature request: yorick statement on the command line 
Author Message
Yorick Master

Joined: Tue Mar 07, 2006 10:31 pm
Posts: 125
Location: Meudon, France
Post Feature request: yorick statement on the command line

I think it would be great to add a command line switch to specify some arbitrary yorick statement(s) on the command line. I also think it must not be too difficult to code with the new virtual files system.

I am not sure whether yorick should quit after executing those statements. I believe it should not quit. There could be two different switches, like we have -i and -batch, let me call them -c and -q. -c would execute the statement(s), then give the prompt, -q would execute the statement in batch mode, then quit yorick.

For example:
yorick -i myfuncs.i -c "myinit(params);"

would include myfuncs.i, then execute myinit(params), then give me a yorick prompt.

yorick -q "exp(23.1)"

would just output the result (1.07697e+10) then exit. It would be equivalent to
yorick -c "exp(23.1); quit;"
except that one is in batch mode while the other is not.

Best regards, Thibaut.

Thu May 20, 2010 11:23 am
Profile WWW
Yorick Master

Joined: Mon Nov 22, 2004 9:43 am
Posts: 354
Location: Livermore, CA, USA
Of course, -q is already a command line switch, which suppresses reading custom.i. This idea has occurred to me also, but I haven't gotten around to doing anything about it. The function to be modified is process_argv; you can create your own version and use it instead of the defalt one by putting it in a private ~/yorick/custom.i. You will also want to understand all the various override hooks for that function intended to be used by other packages; see i0/std.i.

Thu May 20, 2010 6:35 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.