Author Topic: Command line arguments evaluation  (Read 7954 times)

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Command line arguments evaluation
« on: August 29, 2014, 02:47:28 pm »
Hi

Attached a patch to solve two issues:
1. The commandLine argument --file=c:\foo\bar.cpp:42
   should make CB open the file c:\foo\bar.cpp and show line 42.
   in fact it only opened the file without showing line 42.
   The reason for this is the colon after the drive letter.
2. If a cb instance is already running, the app of a second instance doesn't evaluate command line arguments given by plugins.
   With this patch, it becomes possible for plugins to receive command line arguments in the first instance (additional event).
   The realized solution does send the cmd line to the first instance where it is possible for plugins to check the Parse results.
   Patch to cbDiff-plugin http://forums.codeblocks.org/index.php/topic,12829.0.html to show the usage is also attached.

Any objections? If not, I will apply it in a few days.

wxWidgets bug which brings old arguments on new Parse() runs is already corrected, see here: http://trac.wxwidgets.org/changeset/77502

Is anbody maintaining the cbDiff plugin?

regards danselmi

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Command line arguments evaluation
« Reply #1 on: August 29, 2014, 04:51:17 pm »
Is anbody maintaining the cbDiff plugin?
Not to my knowledge. In fact I rarely used it... is it still working OK?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Command line arguments evaluation
« Reply #2 on: August 31, 2014, 07:30:20 pm »
Is anbody maintaining the cbDiff plugin?
Not to my knowledge. In fact I rarely used it... is it still working OK?
Yes the version from https://github.com/ywx/cbDiff/trunk is still working.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Command line arguments evaluation
« Reply #3 on: September 05, 2014, 08:19:59 am »
...btw: with respect to the patch:

This line:
Code
delete wxMessageOutput::Set(new cbMessageOutputNull); // no output
in app.cpp will cause a compilation error:

app.cpp:1096:44: error: cannot allocate an object of abstract type '{anonymous}::cbMessageOutputNull'
app.cpp:297:7: note:   since type '{anonymous}::cbMessageOutputNull' has pure virtual functions

This should be fixed before a possible commit.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Command line arguments evaluation
« Reply #4 on: September 05, 2014, 09:38:41 am »
...btw: with respect to the patch:

This line:
Code
delete wxMessageOutput::Set(new cbMessageOutputNull); // no output
in app.cpp will cause a compilation error:

app.cpp:1096:44: error: cannot allocate an object of abstract type '{anonymous}::cbMessageOutputNull'
app.cpp:297:7: note:   since type '{anonymous}::cbMessageOutputNull' has pure virtual functions

This should be fixed before a possible commit.

Which wx version have you tested? 2.8 or 3.0?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Command line arguments evaluation
« Reply #5 on: September 05, 2014, 10:15:03 am »
Which wx version have you tested? 2.8 or 3.0?
Ooops - I forgot to tell: wx30, 64 bit.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Command line arguments evaluation
« Reply #6 on: September 11, 2014, 09:19:12 pm »
...
This should be fixed before a possible commit.
Please test with the attached patch.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re:
« Reply #7 on: September 30, 2014, 08:11:36 pm »
Patch tested and this one works for all of my builds.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline seahawkibiza

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Command line arguments evaluation
« Reply #8 on: April 01, 2015, 01:24:59 pm »
I know, its a old thread, but I have the same problem.

I build from a fresh svn_trunk.

I use wheezy on armhf, wxWidgets 2.9.4 with opengl support

I get the same error
app.cpp:1096:44: error: cannot allocate an object of abstract type '{anonymous}::cbMessageOutputNull'
app.cpp:297:7: note:   since type '{anonymous}::cbMessageOutputNull' has pure virtual functions

but cant apply the patch, because is too old.

Any solutions?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Command line arguments evaluation
« Reply #9 on: April 01, 2015, 05:16:41 pm »
wxWidgets bug which brings old arguments on new Parse() runs is already corrected, see here: http://trac.wxwidgets.org/changeset/77502
BTW. I think this same bug is causing http://sourceforge.net/p/codeblocks/tickets/133/

The passed file on the command line is opened twice and something bad happens:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]