From 14b8b8701ad262eed403c8dc344c5605eda759eb Mon Sep 17 00:00:00 2001 From: jojobyte <184880+jojobyte@users.noreply.github.com> Date: Fri, 4 Feb 2022 09:05:18 -0700 Subject: [PATCH] feat(webi): add help command to powershell --- _webi/webi-pwsh.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/_webi/webi-pwsh.ps1 b/_webi/webi-pwsh.ps1 index a8bec4c..5bee81f 100644 --- a/_webi/webi-pwsh.ps1 +++ b/_webi/webi-pwsh.ps1 @@ -74,6 +74,32 @@ if (!$has_local_bin) # {{ baseurl }} # {{ version }} +## show help if no params given or help flags are used +if ($exename -eq $null -or $exename -eq "-h" -or $exename -eq "--help" -or $exename -eq "/?") { + Write-Host "webi " -ForegroundColor Green -NoNewline; Write-Host "v1.x " -ForegroundColor Red -NoNewline; Write-Host "Copyright 2020+ AJ ONeal" + Write-Host " https://webinstall.dev/webi" -ForegroundColor blue + echo "" + echo "Webi is the best way to install the modern developer tools you love." + echo "It's fast, easy-to-remember, and conflict free." + echo "" + echo "Usage:" + echo "" + echo " To install things:" + echo " webi [@version] [thing2] ..." + echo "" + echo " To uninstall things:" + echo " rm -rf ~/.local/opt/" + echo " (see, for example, https://webinstall.dev/ for any special notes on uninstalling)" + echo "" + echo "FAQ:" + echo "" + Write-Host " See " -NoNewline; Write-Host "https://webinstall.dev/faq" -ForegroundColor blue + echo "" + echo "And always remember:" + echo " Friends don't let friends use brew for simple, modern tools that don't need it." + exit 0 +} + # Fetch .ps1 # TODO detect formats $PKG_URL = "$Env:WEBI_HOST/api/installers/$exename.ps1?formats=zip,exe,tar"