// Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 #include #include #include #include #include "shavePadCmd.h" const MString shavePadCmd::commandName("shavePadCmd"); shavePadCmd::shavePadCmd() {} shavePadCmd::~shavePadCmd() {} void* shavePadCmd::createCmd() { return new shavePadCmd(); } MStatus shavePadCmd::doIt(const MArgList& argList) { MStatus st; if (argList.length() < 2) return MS::kInvalidParameter; MString cmd = argList.asString(0); unsigned int numArgsRequired = (unsigned int)argList.asInt(1); unsigned int i; for (i = 2; i < argList.length(); i++) cmd = cmd + " \"" + argList.asString(i) + "\""; for (; i < numArgsRequired + 2; i++) cmd = cmd + " \"\""; st = MGlobal::executeCommand(cmd, false, true); return st; }