Bug 115662

Summary: -F commandline switch not working
Product: [Applications] kst Reporter: Nicolas Brisset <nicolas.brisset>
Component: generalAssignee: Netterfield <netterfield>
Status: RESOLVED FIXED    
Severity: normal CC: kst
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Solaris   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Small test case

Description Nicolas Brisset 2005-11-04 11:23:58 UTC
Version:           1.2.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

It seems the -F commandline switch does not work as "advertised" in "kst --help":
"kst -x INDEX -y VEC1 data.txt" works
while
"kst -x INDEX -y VEC1 -F data.txt" does not load anything

Either it is a bug in the -F commandline switch handling, or misleading documentation in "kst --help". In any case, it would be nice to fix it.
Comment 1 Nicolas Brisset 2005-11-04 11:25:57 UTC
Created attachment 13271 [details]
Small test case

Don't forget to configure the ASCII datasource in kst settings to read field
names from line 0 and data in free format from line 1 to try the suggested
example.
Comment 2 George Staikos 2005-11-04 18:23:24 UTC
On Friday 04 November 2005 05:23, Nicolas Brisset wrote:
> It seems the -F commandline switch does not work as "advertised" in "kst
> --help": "kst -x INDEX -y VEC1 data.txt" works
> while
> "kst -x INDEX -y VEC1 -F data.txt" does not load anything
>
> Either it is a bug in the -F commandline switch handling, or misleading
> documentation in "kst --help". In any case, it would be nice to fix it.


   The documentation in --help says:
  {"F <dataFile>", I18N_NOOP("Specify data file: used to override a kst file 
default"), "|"},

   It's used to override the data file in a kst file.  How should we change it 
to make it more clear?
Comment 3 Nicolas Brisset 2005-11-07 10:10:41 UTC
OK, so this is a documentation issue... Well, I think your explanation is clear enough, so we should use it ("Specify data file: used to override the data file in a kst file"). Of course, when more than one datasource (datafile) is used in the .kst, this messes things up quite a bit: should we warn against that ? (If it is complicated to do, I'd suggest not doing anything as a user using this commandline switch probably knows what he's doing)
Comment 4 George Staikos 2005-11-07 17:36:29 UTC
On Monday 07 November 2005 04:10, Nicolas Brisset wrote:
> 10:10 ------- OK, so this is a documentation issue... Well, I think your
> explanation is clear enough, so we should use it ("Specify data file: used
> to override the data file in a kst file"). Of course, when more than one
> datasource (datafile) is used in the .kst, this messes things up quite a
> bit: should we warn against that ? (If it is complicated to do, I'd suggest
> not doing anything as a user using this commandline switch probably knows
> what he's doing)


  I thought about this as well.  We don't have any consideration for files 
with > 1 data source.  Barth, any comments?  Should we just leave it as-is?
Comment 5 Netterfield 2005-11-08 16:17:40 UTC
I can modify the behavior so that it behaves more forgivingly....
Comment 6 George Staikos 2005-11-09 04:07:03 UTC
So that we're clear. :-)
Comment 7 Netterfield 2005-12-11 07:07:57 UTC
SVN commit 487589 by netterfield:

BUG: 115662

Improve documentation for -F option.



 M  +1 -1      main.cpp  


--- trunk/extragear/graphics/kst/kst/main.cpp #487588:487589
@@ -48,7 +48,6 @@
 static QStringList startupErrors;
 
 static KCmdLineOptions options[] = {
-  {"F <dataFile>", I18N_NOOP("Specify data file: used to override a kst file default"), "|"},
   { "y <Y>",  I18N_NOOP("Field for Y axis (multiple allowed)"), 0 },
   { "z <Z>",  I18N_NOOP("Field for a Z image (multiple allowed)"), 0 },
   { "ye <equation>",  I18N_NOOP("Equation for Y axis (multiple allowed)"), 0 },
@@ -72,6 +71,7 @@
   { "print <file>",  I18N_NOOP("Print to file and exit"),"<none>"},
   { "png <file>",  I18N_NOOP("Save as a png file and exit"),"<none>"},
   { "nq",     I18N_NOOP("Bypass the quickstart dialog"), 0},
+  {"F <dataFile>", I18N_NOOP("Override a *.kst file's data file with <datafile>"), "|"},
   { "+[Files]", I18N_NOOP("Data files (if -y given) or *.kst file"), 0},
   KCmdLineLastOption
 };
Comment 8 Nicolas Brisset 2006-04-04 23:46:08 UTC
I am tempted to reopen that one, as there are cases where we'd like to override more than one datafile. Something like -F1 file1.dat -F2 file2.dat would be very cool and sounds pretty much user-friendly to me. Is that OK ?
(A new option that would just parse the .kst file to list datasources in the right order would be a nice complement, but maybe that's a separate issue ?)
Comment 9 Nicolas Brisset 2006-06-23 15:43:20 UTC
Can I reopen this one ? I have had many users ask for this again, and I think it would be nice to do what I suggest in the first part of comment #8. This is not critical (they currently use sed on the .kst !!) but if there's a chance...