I am trying to create a configuration script in perl that will make changes in two parameters , I need to know the ideal construct [closed]

StackOverflow https://stackoverflow.com/questions/17545671

문제

So far I am using the following construct

configure.pl <$ARGV[0]> <$ARGV[1]>

each given argument can be

+n = to increase the current service by n 
-n = to decrease the existing services by n
n = to create n number of services ( irrespective of the number of existing services )

I have a doubt whether this is the correct construct , I also have problems in fixing what should i have for nochange (ie existing services should continue ) .

도움이 되었습니까?

해결책

The command-line interface you propose is perfectly fine as long as it's documented.

The GNU coding standards recommend providing long options. It is easy to have those in addition to the short options with Getopt::Long::Descriptive.

--inc=n
+n
        to increase the current service by n

--dec=n
-n
        to decrease the existing services by n

--abs=n
n
        to create n number of services (irrespective of the number of existing services)

--no-op
        no change in operation, existing services continue as is
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top