lukesampson / pshazz

Give your powershell some pizazz.
The Unlicense
575 stars 40 forks source link

Scoop command aliases #95

Closed josh-degraw closed 5 years ago

josh-degraw commented 5 years ago

I just found pshazz and scoop and I've got to say I am a big fan so far, but I'm having one small issue that I would love some clarification with.

I installed the coreutils package in scoop, and basically I'm just trying to do a simple alias for ls to resolve to ls --color by default.

Nothing I've tried seems to be working, including resolving it to an absolute path, and the documentation for aliases is lacking at best. It took me a while to find it since it's under themes instead of its own spot.

The gist of what I'm asking is whether it's currently possible to resolve an alias to a scoop command and parameterize that, and if so how is that done?

chawyehsu commented 5 years ago

You can change aliases via the aliases field in a pshazz's theme like this: https://github.com/lukesampson/pshazz/blob/master/themes/lukes.json#L15-L20

So I guess you need to remove the powershell built-in ls alias to use the ls command from coreutils, and then add a ls alias to ls --color.

josh-degraw commented 5 years ago

Yeah, I tried that, it didn't work. I was able to get the regular ls to resolve correctly, but it's just not getting the parameter passed in.

With this as my alias config:

"aliases": {
     "rm": [ "ls" ],
     "add": {
        "ls": "ls --color"
     }
}

If I run it with or without the add field, it does exactly the same thing, which is just the standard ls command.