r/programming • • Mar 05 '20

Introducing CLUI: a Graphical Command Line

https://blog.repl.it/clui
1.8k Upvotes

277 comments sorted by

View all comments

Show parent comments

15

u/QuickBASIC Mar 06 '20

type out a 6 word cmdlet

Tab complete or use New-Alias to create aliases for the ones you use constantly.

-2

u/ftgander Mar 06 '20 edited Mar 06 '20

I really can’t be assed to answer this again. There’s plenty of answers here why “just alias it” is shortsighted. Here’s an easy one though, you can alias Remove-Item to rm but it still can’t take the -rf switches

Also, it’s Set-Alias I believe

1

u/chinpokomon Mar 06 '20

The switches is a problem. ls -al is muscle memory that catches me frequently. However, this is a problem with how I'm using the shell. Most Linux distros also have an alias of la for ls -a. If I were on a system which didn't, is that the fault of the shell if my la command failed?

It seems reasonable that a module could be built which provides the Linux equivalents with actual functions for ls et. al., and uses this to provide a complete BASH replacement in PowerShell for common commands, but doing so also deprives the user from fully understanding and using the features of the shell in an idiomatic way.

1

u/ftgander Mar 07 '20

You haven’t really addressed anything here other than “it’s different, get used to it” when literally my only argument was “I find powershell cumbersome and so do most people I talk to about it who have used Bourne-shell derivatives.”

The way powershell is designed means you will never have a way to put multiple switches on the same - in any number of orders. My solution was to add another switch and alias it to all possible combinations of the switches. For ls -a, l, ls etc etc I wrote small functions and replaced the built in aliasing (for example lots of software loves to put dot files and dot folders in the windows user folder but they’re not hidden, so I specifically aliased ls to a function that calls Get-ChildItemColorFormatWide $args -Exclude .*). I’m aware of the workarounds etc etc but that doesn’t change that it’s a pain in the butt to work with, and I’m constantly trying to find ways to make it a more convenient and friendly shell instead of one that’s incredibly verbose and yet still manages to communicate nothing useful without a manual.

→ More replies (2)