From be58d6a9e598215addc343973201f42cb8767733 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 16 Dec 2025 16:45:15 +0000 Subject: [PATCH] if not in interactive, check a script was passed --- examples/cli/CLI.ps1 | 4 ++++ examples/cli/README.md | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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