Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the eclipse launch configuration string prompt for two values?

Prompting the user in the Eclipse external tool run configuration is simple enough:

${string_prompt:"Enter a string":"DefaultString"}

However, is there a way for me to configure my run configuration to use this as two separate arguments to my external tool? Something that would result in:

my.exe --arg1=${string_prompt1} --arg2=${string_prompt1}

I definitely don't want to push this logic into the application, itself. I just want to simplify a local test build configuration. Any ideas?

like image 905
kevinmm Avatar asked Dec 20 '12 05:12

kevinmm


People also ask

How do I open launch configuration?

Open a Launch Configuration DialogRight-click in the EventFlow Editor canvas for your application. From the context menu, select Run As → Run Configurations. In the Package Explorer, right-click the name of your application's EventFlow or StreamSQL file. From the context menu, select Run As → Run Configurations.

What does launch do in Eclipse?

Launching in this context is defined as running or debugging a program from within the Eclipse IDE. A launcher is a set of Java classes in an Eclipse plug-in that performs launching. The framework allows defining launch configuration types which defines how launch configuration are created.


1 Answers

You can have only one prompt in which you can pass as many arguments as you want separated by spaces. The strings you provide with the prompt will be assigned to args variable of public static void main method of your class.

To provide defaults for more than a argument, you could use something like this:

${string_prompt:"Enter two values separated by space":firstDefault secondDefault}

If you need to repeat your test many times with same parameters, you can think about using a saved run configuration in which you fix your parameters (just list them into "Program arguments" of "Arguments" tab).

like image 105
giampaolo Avatar answered Sep 19 '22 20:09

giampaolo