Author Topic: Add Command Line Argument to plugin?  (Read 6987 times)

Offline yasman

  • Single posting newcomer
  • *
  • Posts: 5
Add Command Line Argument to plugin?
« on: January 29, 2012, 01:49:11 pm »
I've searched, but can't seem to find..

Short of re-compiling the source of course, is there a way to change the arguments of a specific plugin?

In this code I would like to add --force to cppcheck?

Thanks for any advice!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Add Command Line Argument to plugin?
« Reply #1 on: January 29, 2012, 02:06:28 pm »
No, you can't, you have to change the code and them compile it.
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Add Command Line Argument to plugin?
« Reply #2 on: January 29, 2012, 04:49:08 pm »
In theory yes, create a script file with same name as exec the CB program calls the script file.
And, the script file calls the exec. Note, in this exact instance it might not work.

NOTE: This is NOT for adding a command line argument to the plugin; but, adding a command line argument to the exe called by the plugin.

Tim S.
« Last Edit: January 29, 2012, 05:39:56 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Add Command Line Argument to plugin?
« Reply #3 on: January 29, 2012, 05:20:50 pm »
No, you can't, you have to change the code and them compile it.
True, but it should be very easy to patch. E.g. prompting for additional parameter before running cppcheck should be a 3-5 liner. Patches are welcome.
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 yasman

  • Single posting newcomer
  • *
  • Posts: 5
Re: Add Command Line Argument to plugin?
« Reply #4 on: January 29, 2012, 10:48:57 pm »
Thanks for the replies, and yes it should be an easy patch..

After looking at the code, I found this dirty workaround...

I added the following include path (although I'm sure it will break my build...):

 
Quote
./" --force "./

Worked good to add the argument I wanted.  Thanks to all.