cyberrumor / ammo

Almost Manual Mod Organizer - Linux MO for Bethesda Games
GNU General Public License v2.0
25 stars 6 forks source link

short command aliases #46

Closed duran55 closed 5 months ago

duran55 commented 6 months ago

It would be good to have short command aliases for these two commands: q for quit, h for help. And maybe for other commands too.

cyberrumor commented 6 months ago

I was actually having a think about this too. Controllers would probably need to set up an Argparse parser that the UI class can subscribe to. I want to keep away from hard-coding commands that are in the controller into the UI class.

cyberrumor commented 6 months ago

If you need a bandaid fix in the meantime, you can hack in this kind of thing:

def i(self, index: int) -> None:
    return self.install(index)
cyberrumor commented 5 months ago

Added a command for 'q' which will alias 'exit'.

Since the addition of tab completion, you can already type the shortest unique string for a command then use tab complete to find the rest of it, which is just one extra keystroke. As for help, 'h' (or any unknown command) will already print the help menu. You'll get an extra error saying 'h' isn't a command but it won't hurt anything and still does what we need, so no changes there.