claptrap 0.3.0

Bring the power of Clap to shell scripts.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env pwsh

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest

$spec = @'
name = "myapp"
version = "0.1.0"
[args]
mode = { short = "m", long = "mode" }
protocol = { short = "p", long = "protocol" }
'@
. ([scriptblock]::Create(( $spec | & $env:CLAPTRAP_BIN --spec - --output-format powershell -- @args ) -join "`n"))

Write-Output "mode: $env:claptrap_mode"
Write-Output "protocol: $env:claptrap_protocol"