Checking whether program foo supports option --bar

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all,

Is there a conventional / recommended way to test whether a program
supports a given command-line option?

I understand the test needs to be somehow program-specific but I still
wonder whether there are some macros around that can be used to make
writing this test simpler.

To be more specific, I need to test whether diff supports the -u and
--strip-trailing-cr options.

I intend to call diff with two times the same argument, namely a file in the
source tree, so that the call fails only if the option is not supported.

Does this make sense to you?

Ultimately the code will have to be flexible enough for the test to work
even when configure is not called from the top source directory.

thanks,

Sébastien.




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux