Link to home
Start Free TrialLog in
Avatar of AnuPutcha
AnuPutcha

asked on

How to use parse_opts to specify CVS tree as an option

I have a perl script which will need a way to specify the version of the tool that it will invoke.

Eg: run_app -cvstree  app_1.0.1.

I will be using parse_opts to parse the cmd line options. But it not clear to me how to write code to pick the CVS Tree branch as specified in the cmd line option.

Thanks,
Anu.
Avatar of Suhas .
Suhas .
Flag of United States of America image

Hi AnuPutcha,
To run command line options in script use system:

system("run_app -cvstree app_1.0.1");

Cheers!
Suhas
Avatar of Adam314
Adam314

Could you clearify, I'm not sure what you want to do?
use Getopt::Long;
my $branch;
$result = GetOptions("cvstree=s" => \$branch);

Avatar of AnuPutcha

ASKER

I want to be able to specify a CVS branch as an option to a perl script so that the right version of the script is selected. Also can someone tell me how to see the CVS tree/ a cmd to see CVS tree?


Thanks
How would you specify which branch to run if you ran it from the command line?
Or how would you view a particular version of a file if you wanted to view it?

Once you have that, use the system command to start the same script, but the correct version.  

ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You are correct, apparently I cannot access a version without checking it out locally. I din't know this before and so I was thinking I could do that and wnated to know how to access CVS branch without checking it out.

Thanks!