Adding MSytax Into Your Commands
As seen previously, parsing arguments using the MArgList class is possible, however it is long winded and easy to slip in errors. To simplify this process Maya has added to utility classes :
MSyntax - used to define the syntax for your command
MArgDatabase - used to parse the command arguments
So then, the main thing we require is a static function that returns a new syntax object to Maya when we register a function.
This can be done like so :