4 ms·
This is one of the things that I love in PowerShell. It autocompletes the command from all of the commands available through either scripts or modules on the p
by AndrewDucker 8y ago
This is one of the things that I love in PowerShell. It autocompletes the command from all of the commands available through either scripts or modules on the path, and then it autocompletes parameters (their names, and when they're an enumeration, the value). Discoverability makes life much much easier.
- saagarjha 8y agoHow does this differ from bash-completion?
- chuckdries 8y agoI think he's implying it's built in by default? I personally have never observed it, but I don't really use powershell so maybe I'm doing something wrong
- yaleman 8y agoBash completion for every single installed module isn't baked in on every install?
- saagarjha 8y agoI know of multiple Debian systems I've used with decent bash-completion for most commands out-of-the-box–now, whether this was because it had already installed bash-completion and the associated completion files for each preinstalled APT package in the bash-completion directory, I don't know.
- oblio 8y agoBash completion scripts have to be hand written for each command. Ok, at best they can be autogenerated from some tool if the command's development environment has a tool for it. But many of these scripts are handwritten. So they have to be created by humans and then installed on the system. Far from auto-introspection into a standard API.
- ajuc 8y agoThere's nothing in linux that is baked in on every install except for kernel. On most desktop/server distributions bash-completion is installed by default. On embedded it mostly isn't.
- AndrewDucker 8y agoI've not encountered bash-completion. Is it built into bash, and working for every single script and module by default?
- majewsky 8y agobash-completion is a package containing pretty capable autocompletion functionality for a large set of common Unix/Linux commands. It is not installed by default on some distributions for reasons that are beyond me.
- PurpleRamen 8y agoIt's a matter of scope. For bash pretty much everything is foreign, so it can only autocomplete if it get's some external source information for it, which usually means someone must write/generate it. Powershell on the side is an object-orientated shell, and makes big efforts to pull everything into it's objectspace so it can use it's introspection-abilities to deliver as much information as possible about a command. Thus it can generate the neccessary informations for autocompletion on the fly. Powershell is more like IPython (with .NET as backend) then bash.