yori icon indicating copy to clipboard operation
yori copied to clipboard

Usage details for builtins?

Open stianhoiland opened this issue 1 year ago • 3 comments

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 avatar Aug 16 '24 07:08 stianhoiland

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

stianhoiland avatar Aug 16 '24 07:08 stianhoiland

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.

malxau avatar Aug 19 '24 05:08 malxau

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.

stianhoiland avatar Aug 19 '24 08:08 stianhoiland