malxau / yori

Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
http://www.malsmith.net/yori/
MIT License
1.23k stars 30 forks source link

Usage details for builtins? #125

Open stianhoiland opened 4 weeks ago

stianhoiland commented 4 weeks ago

Hey! I'm new to Yori and I love it. What a great work of passion!

I find myself typing help quite often, and still not finding out how to do or use things.

For example I wanted to make the cd command (which is not mentioned in Yori's help command) always dir afterwards, so I tried alias cd cd && dir. Admittedly that was stupid in more than one way, but okay so now I go look at how to use the alias command, and neither alias -h, alias --help nor alias -help does anything. So I go look at https://www.malsmith.net/yori/guide/, and not even here is the syntax for alias explained.

I know it's simple and you probably only need to learn it once and you develop your CLI intuition after a while, but I'm wondering if there is a builtin way to find this kind of information?

stianhoiland commented 4 weeks ago

Looks like I also managed to mess up the hidden cd alias? And I'm guessing I also managed to fix it using alias cd=chdir $*$? xD

malxau commented 3 weeks ago

Aliases are still single commands. Multi-command sequences can be done via scripts, but not aliases. The builtin aliases weren’t meant to be hidden, I just didn’t want the default “alias” output to include things users didn’t do explicitly. They can be displayed with “alias –s”. Most commands, including alias, have a “-?” help text that attempts to be comprehensive.

stianhoiland commented 3 weeks ago

Aha! So it's -?. I would never have guessed! I will try it out next time I'm at my Windows machine; so too with alias -s.

And I see: I'll create a little script for my cd && dir purpose, and alias the script. Thanks for the guidance.