Skip to content

Commit ba905be

Browse files
author
James Brundage
committed
feat: Adding Transform Command Type (Fixes #579)
1 parent 5471e84 commit ba905be

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

PipeScript.ps.psd1

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,36 @@
153153
)
154154
'
155155
}
156+
157+
'Transform' = @{
158+
Description = 'Transforms'
159+
Pattern = '
160+
(?>
161+
# Transforms have two forms, one that is very "query" friendly
162+
\=\> # =>
163+
(?<TransformName>[^\p{Ps}\<]+)? # Optional transform name
164+
[\p{Ps}\<] # Transform From Type Start
165+
(?<TransformFrom>[^\p{Pe}\>]+) # TransformFrom
166+
[^\p{Pe}\>] # Transform From Type End
167+
(?:
168+
\=\> # =>
169+
(?<TransformToName>[^\p{Ps}\<]+)? # Optional to name
170+
[\p{Ps}\<] # Transform To Type Start
171+
(?<TransformTo>[^\p{Pe}\>]+) # Transform To
172+
[^\p{Pe}\>] # Transform To Type End
173+
)?
174+
|
175+
# The other form is fairly normal:
176+
Transform(?>s|er)? # Transform or Transforms or Transformer
177+
(?>
178+
\.ps1$ # ending with .ps1
179+
| # or
180+
\p{P} # followed by punctuation
181+
)
182+
)
183+
'
184+
ExcludeCommandType = '(?>Application|Script|Cmdlet)'
185+
}
156186

157187
'Template' =
158188
@{

0 commit comments

Comments
 (0)