Passing named arguments in launch.json - spring-boot

I am trying to pass named arguments to launch.json as program arguments in VSCode.
--myArgument=My Argument Value
So that I can catch this named property in Spring Boot as an external property.
I have tried the "args" key but this passes them to the main function.
Is there a way to achieve this in the VSCode Java Debugger?

Related

How can I get command line arguments in a Qt Installer Framework script?

I am writing a Qt Installer Framework script, and I would like to allow the user to launch the installer with arguments and then apply those arguments in various ways. For example, a switch to auto accept the EULA, a means to directly pass the target directory, a list of the components to be installed, etc.
The syntax to pass arguments to QIFW installer is Key=Value.
You can provide command line argument like below
YouInstaller.exe Arg1=true
Then you can get this value in Component or Controller script as below
var Arg1 = installer.value('Arg1')
installer QML Type
Controller Script

Use VS envirenment-variables as command-line args

I can use envireonment-variables such as $(TargetFileName) in my pre- and post-build-events. What I want to do is apply those variables to the command-line args of an external program (in my case nunit). So whenever my app starts I want to start another one with the file-name of the first as arg.
Is this possible?
When debugging my project the nunit-windows appears but shows an error-message that the given assembly $(OutDir)$(TargetFileName)$(TargetExt) could not be found. I suppose that the variables are only available during build but not during run so it seems I have to hardcode the parameters to the command-line args. Is this true?

Spring boot get command line args in configuration code

I got Spring boot with Spring batch project. Inside my BatchConfiguration I want to get command line arguments so I #Autowire Environment object and try to get my prop but I'm getting null.
After some debug I figured out that I can get all command line args via special property Name "nonOptionArgs" but in this case I got plain string of all arguments passed. Is there some better solution?
Thanks
You are doing everything right with autowired environment. Make sure you pass arguments in the command line with "--"
From documentation:
By default SpringApplication will convert any command line option
arguments (starting with ‘--’, e.g. --server.port=9000) to a property
and add it to the Spring Environment. As mentioned above, command line
properties always take precedence over other property sources.
you can run your app like this:
$ java -server -Dmyproperty=blabla -jar myapp.jar
and can access the value of myproperty in code.

Xamarin: How do I pass commandline parameter when debugging?

Using Xamarin 4.2.3(60), I want to debug a .NET app that takes command line args, I have tried setting the projects General parameters , eg, "/p /Users/Tester/Automation", but when I run in the debugger the Mina method string[] args is null? I have also tried setting the "Run With -> Custom Parameters by editing the Default setting the Arguments = "/p /Users/Tester/Automation" and Working dir to "/Users/Tester/Automation", but when I then "Run with" and choose the saved Custom mode, the program still does not appear to have been passed the arguments?
Anyone know how to run the debugger and pass command line args to the program being debugged?
You can add command line arguments via the Parameters field within Project Properties -> Run -> General.
EG:

VB6 Debugger - Command line arguements

In the VB6 IDE there is a window were you can specify command line arguements (for debugging). If you create a .exe with arguements specified, will they be published with the application? I don't believe they will.
No, they will not. This is just for testing your application if it uses command line arguments. It allows you to specify your command line arguments and step through exactly like if the program was called with those command line arguments.
For example, you normally pass parameters by simply calling your EXE and providing the parameters at the same time. So, if you normally call your program like such
C:\test.exe /test /inet /copy
You would simply set the command-line arguments to
/test /inet /copy
in the VB6 IDE

Resources