Python cmd module command aliases

I am making a command line interface in Python 3.1.1 using the cmd module.

Is there a way to create a command with multiple names, eg. "get out" and "get out"? Or is it just a case of creating multiple commands that reference the same function?

+2


source to share


1 answer


Yes, it would be easy to make multiple commands that refer to the same function.



This is a common occurrence. This often helps to provide several common aliases for the command. This makes life easier for the user because the likelihood of guessing them correctly is improved.

+4


source







All Articles