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:

Code:

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

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

Code:

yorick -q "exp(23.1)"

would just output the result (1.07697e+10) then exit. It would be equivalent to

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.

Who is online

Users browsing this forum: No registered users and 1 guest

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