I have a golang binary named test. I have two flags -p and -s. I want user to pass them like below scenarios:
1) ./test -p
2) ./test -s serviceName
3) ./test -p -s serviceName
Means -p should be passed with empty value and -s should be passed with any service name. 1 and 2 are working fine but in third -p flag is taking value "-s". What i want from 3rd is -p should be empty value ("") and -s should be "serviceName"
I have a golang binary named test. I have two flags -p and -s. I want user to pass them like below scenarios: 1) ./test -p 2) ./test -s serviceName 3) ./test -p -s serviceName
Means -p should be passed with empty value and -s should be passed with any service name. 1 and 2 are working fine but in third -p flag is taking value "-s". What i want from 3rd is -p should be empty value ("") and -s should be "serviceName"