Robert Klemme
4/27/2009 6:21:00 AM
On 27.04.2009 06:28, Newb Newb wrote:
> hi i m using optparse.
>
> in that for copying i have implemented like below
>
> opts.on('-r', '--recursive RECURSIVE',
> "specify for recursive copy" ) do | r|
>
> options.recursive = true
>
> end
>
> opts.on('-o', '--overwrite OVERWRITE',
> "specify to copy files overwriting the previous ones" ) do | o|
>
> options.overwrite = true
>
> end
>
>
> if i use -r it does recursive copy without deleteing existing folders.
>
> and if i use -o it does overwritting of given files..
>
> is it possible to use both command at once...
That actually seems to be not a question about OptionParser but rather
your implementation, which we cannot see. With OptionParser you can
have both options on the command line. Your code just needs to react
properly (i.e. in your intended sense) on those options.
Kind regards
robert