[p4ruby] Unexpected errors (warning newbie)

Tony Smith tony at smee.org
Tue Mar 8 06:50:45 PST 2005


On Tuesday 08 March 2005 12:33, Robin Charlton wrote:
> Apologies if the answer to this question is trivial - I'm just starting out
> with ruby and p4 scripting....

No problem :)

> Why I try and execute the following command at a dos command line it works
> fine, but when I execute it through the ruby P4 object errors are reported,
> as follows:
>
> p4.run_integ("-d -t -f -n //Depot/Antics/Admin/General.dot
> //Depot/Antics/Admin/General2.dot")
>
> Errors:
> Warnings:
> Usage: integrate [ -c changelist# -d -D<flag> -f -h -i -I -n -r -s -t from
> -v ] [ -b branch to... | from to ]
> Invalid option: - -t -f -n //Depot/Antics/Admin/General.dot
> //Depot/Antics/Admin/General2.dot.
> c:/ruby/lib/ruby/1.8/P4.rb:122:in `run': [P4#run] Errors during command
> execution( "p4 integ -d -t -f -n //Depot/Antics/Admin/General.dot
> //Depot/Antics/Admin/General2.dot" ) (P4Exception)
>  from c:/ruby/lib/ruby/1.8/P4.rb:122:in `method_missing'
>  from p4_refactor.rb:281
>
> What's going on here?

You need to quote the arguments separately. This is so P4Ruby can support 
arguments with spaces in them. So you need to do something like this:

p4.run_integ( "-d", "-t", "-f", "-n",
   "//Depot/Antics/Admin/General.dot",
   "//Depot/Antics/Admin/General2.dot")

Tony



More information about the p4ruby mailing list