package webserver;

import org.slf4j.MDC;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Client {

    public static void main(String[] args) {
        MDC.put("pid", getPid());
        SpringApplication.run(Client.class, args);
        MDC.clear();
    }

    private static String getPid() {
        String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName();
        return processName.split("@")[0];
    }
}

@@ -13,16 +13,147 @@
 erver;%0A%0A
+import helpers.CommandLineArgumentParser;%0Aimport helpers.PidManipulation;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -333,16 +333,97 @@
 ient %7B%0A%0A
+    private static final Logger logger = LoggerFactory.getLogger(Client.class);%0A%0A
     publ
@@ -482,16 +482,32 @@
 (%22pid%22, 
+PidManipulation.
 getPid()
@@ -509,24 +509,25 @@
 Pid());%0A
+%0A
         
 SpringAp
@@ -522,115 +522,53 @@
     
-SpringApplication.run(Client.class, args);%0A        MDC.clear();%0A    %7D%0A%0A    private static String getPid() %7B
+new CommandLineArgumentParser(args).parse();%0A
 %0A   
@@ -577,137 +577,69 @@
    S
-t
+p
 ring
- processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName();%0A        return processName.split(%22@%22)%5B0%5D
+Application.run(Client.class, args);%0A        MDC.clear()
 ;%0A  

Use parser class to process the program arguments.