3 ms·
I've migrated some of bash scripts I use, so the same script can be used for Windows and Linux. Bash ports on Windows can be messy especially if it involves no
by unsignedint 9y ago
I've migrated some of bash scripts I use, so the same script can be used for Windows and Linux.
Bash ports on Windows can be messy especially if it involves non-Latin codepages, especially when it involves language like Japanese, which frontend is still not migrated fully into UTF-8. (Also WSL handles it more gracefully.)
I am program in C# a lot, so extensibility via CmdLet is also interesting. (Although, I haven't explored this much, yet...)
- luch 9y agoYou should : even if I consider Powershell pretty alien as a language (coming from an old time Windows dev), Cmdlet is vastly superior to other various argument parsing tooling (optparse, argparse, argv, etc.) I've used in the past.
- ZenoArrow 9y ago> "Cmdlet is vastly superior to other various argument parsing tooling (optparse, argparse, argv, etc.) I've used in the past." I can't comment on the other options you listed, but I would agree that PowerShell has good features for parsing arguments (if you use advanced cmdlets, which only require one extra line to enable on basic cmdlet code, for [CmdletBinding()] ). Aside from built-in attributes for enabling common argument checks (like checking for nulls), you can completely customise parameter validation using ValidateScript, which allows you to set up a script that must evaluate as true in order for an argument to be valid. I'd be interested to find out if any Unix command line scripting language offers something similar.