diff --git a/examples/cli/CLI.ps1 b/examples/cli/CLI.ps1 index 1242cfc..36bcbcb 100644 --- a/examples/cli/CLI.ps1 +++ b/examples/cli/CLI.ps1 @@ -54,6 +54,10 @@ function main { read-hostuntilempty -vmr $vmr return } + if ($script.Count -eq 0) { + 'No script provided, exiting' | Write-Host + return + } $script | ForEach-Object { msgHandler -vmr $vmr -line $_ } diff --git a/examples/cli/README.md b/examples/cli/README.md index db3c748..3b04261 100644 --- a/examples/cli/README.md +++ b/examples/cli/README.md @@ -15,11 +15,13 @@ You may pass the following optional flags: for example: -`powershell.exe .\CLI.ps1 -o -k "banana" -s "strip[0].mute", "!strip[0].mute", "strip[0].mute", "bus[2].eq.on=1", "command.lock=1"` +```powershell +.\CLI.ps1 -o -k "banana" -s "strip[0].mute", "!strip[0].mute", "strip[0].mute", "bus[2].eq.on=1", "command.lock=1" +``` Expected output: -``` +```powershell Getting strip[0].mute strip[0].mute = 0 Toggling strip[0].mute