]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / scripts / posh-vcpkg / 0.0.1 / posh-vcpkg.psm1
diff --git a/ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 b/ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1
new file mode 100644 (file)
index 0000000..25ef996
--- /dev/null
@@ -0,0 +1,39 @@
+param()\r
+\r
+if (Get-Module posh-vcpkg) { return }\r
+\r
+if ($PSVersionTable.PSVersion.Major -lt 5) {\r
+    Write-Warning ("posh-vcpkg does not support PowerShell versions before 5.0.")\r
+    return\r
+}\r
+\r
+if (Test-Path Function:\TabExpansion) {\r
+    Rename-Item Function:\TabExpansion VcpkgTabExpansionBackup\r
+}\r
+\r
+function TabExpansion($line, $lastWord) {\r
+    $lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()\r
+\r
+    switch -regex ($lastBlock) {\r
+        "^(?<vcpkgexe>(\./|\.\\|)vcpkg(\.exe|)) (?<remaining>.*)$"\r
+        {\r
+            & $matches['vcpkgexe'] autocomplete $matches['remaining']\r
+            return\r
+        }\r
+\r
+        # Fall back on existing tab expansion\r
+        default {\r
+            if (Test-Path Function:\VcpkgTabExpansionBackup) {\r
+                VcpkgTabExpansionBackup $line $lastWord\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+$exportModuleMemberParams = @{\r
+    Function = @(\r
+        'TabExpansion'\r
+    )\r
+}\r
+\r
+Export-ModuleMember @exportModuleMemberParams\r