[p4] PowerShell Integration

mancaus.40868864@bloglines.com mancaus.40868864 at bloglines.com
Fri Dec 1 02:32:56 PST 2006


Hi Patrick,



I think you mean me... I said it pays a homage to Ruby, which
I think it does. I wouldn't at all be suprised if some of the syntax and features
where Ruby inspired. But you're correct, in the most part it's not like Ruby.



To keep this relevant... here's a section of code you can add to the default
TabExpansion function that comes with powershell. It adds auto-completion
of perforce depot specs. The implementation may be naive as I'm only a powershell
beginner. It can also suffer from an timeout problem in that completion does
nothing if the "p4 dirs" takes too long.



# Complete perforce specs

'^//.*$'
{

  $specs = (p4 dirs ($lastWord + '*'))



  if ( $specs -ne $null ) {

    if ( $specs.GetType() -eq "Object[]" ) {

      $specs

    } else {

      ($specs + '/')

    }

  }

  break;

}



Thanks Robert for the link
to the P4.NET code... looks like a great starting point.



Cheers,

  Blake



--- Bennett wrote:

Actually, Powershell is a completely new command shell
paradigm.  It

> really is.

> It's insanely verbose (but you can fix that
with aliases) and *very*

> different but it has some immense potential.

> 

> ...although I think whoever said it was like Ruby should take it back.

> Powershell is nothing like Ruby.  Powershell made some very... odd

> language
design choices in their language.  Particularly if you're a

> Ruby lover
like myself.  ;)

> 

> 

> Patrick Bennett

> 


More information about the perforce-user mailing list