Skip to content

Commit

Permalink
simplified example
Browse files Browse the repository at this point in the history
  • Loading branch information
ninmonkey committed Sep 5, 2023
1 parent b468ca4 commit e81e398
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Pwsh/Native.Command/ExplicitNativeCommandParsing.ForBat.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function bp4 {
the filename of the command changes some automatic behavior. Like using 'git' vs 'git.exe' causes the same binary to act differently
#>
param(
[switch]$UsingLegacy,
[Management.Automation.NativeArgumentPassingStyle]$UsingStyle
[switch]$UsingLegacy
#, [Management.Automation.NativeArgumentPassingStyle]$UsingStyle
)
if($UsingLegacy) {
$LastPSNative = $PSNativeCommandArgumentPassing
Expand All @@ -17,8 +17,10 @@ function bp4 {
$UsingStyle ?? [System.Management.Automation.NativeArgumentPassingStyle]::Legacy
$PSNativeCommandArgumentPassing | Join-string -f 'was {0}' | write-verbose -verb
}
$items = @( $input )
$items ??= gci . -name -depth 2 -File

$Input
$items
| Where-Object { $null -ne $_ } # Where-IsNotBlank
| fzf.exe -m --preview 'bat --style=snip,header,numbers --line-range=:200 "{}"'

Expand Down

0 comments on commit e81e398

Please sign in to comment.