Improve doCmd generator to protect methods without args

doCmd now supports a seconds argument “needsArgs” that specifies if the
method it generates accepts args or not