Bug 110418 - Mechanism to call scripts from the commandline
Summary: Mechanism to call scripts from the commandline
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: scripting (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: HI wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-08 21:39 UTC by George Staikos
Modified: 2010-08-14 14:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Staikos 2005-08-08 21:39:48 UTC
Kst needs a way for extensions to  add commandline parameters, in particular 
so we can add a commandline parameter for scripts to be launched or JS to be 
evaluated.  I have some concerns right now because getting this right is hard.  
For instance, it's not easy to know when it's 'safe' to execute a script on 
startup.  Also we don't want this option appearing when the extension isn't 
loaded, but we don't want to hardcode parts of the extension into Kst.
Comment 1 Netterfield 2005-12-06 00:33:12 UTC
Based on discussion on list, the UI should be:

Parameters starting with --E are stored as a string, for use by 
extensions which decide they understand them..  (technically, we do this by 
pre-parsing argv before passing it off to KCmdLineArgs)
eg:  kst --Ejs "bolocheck.js -d data.dat -fd filter.dat -f0 1121 -N 20000"
        + keep checking of kst command line parameters
        + extension parameter name space is completely isolated
        ? can extensions report parse errors of their parameters?
        + third parties can add parameters for their extensions.
        - no promise that extensions won't introduce parameter name clashes between themselves (but if they only chose to recognise special cases, this should be OK)
        - the "" bracketed parameter names seem kind of funny.
Comment 2 George Staikos 2005-12-06 06:40:44 UTC
On Monday 05 December 2005 18:33, netterfield@astro.utoronto.ca wrote:
> eg:  kst --Ejs "bolocheck.js -d data.dat -fd filter.dat -f0 1121 -N 20000"


  Instead of adding a complex command-line parser inside Kst, why don't we use 
something similar, but JS based:

kst --Ejs "load(bolocheck.js); myBoloCheckScript(\"data.dat\", \"filter.dat\", 
1121, 20000);"
Comment 3 Netterfield 2005-12-11 07:00:24 UTC
The extension is responsible to interpret the string as it wishes.  The suggested approach for --Ejs looks good.

Comment 4 George Staikos 2005-12-20 18:28:51 UTC
Was already implemented -E "js:loadScript('foo.js')"
Comment 5 Peter Kümmel 2010-08-14 14:40:42 UTC
Change version to 1.x