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

Question

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 ) .

Était-ce utile?

La solution

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top