// Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 #include #include #include #include #include #include #include #include "shaveGlobals.h" #include "shaveIcon.h" #include "shaveIconCmd.h" const MString shaveIconCmd::commandName("shaveIcon"); static const char* kNeedsReloadLong = "-needsReload"; static const char* kNeedsReloadShort = "-nr"; shaveIconCmd::shaveIconCmd() {} shaveIconCmd::~shaveIconCmd() {} void* shaveIconCmd::createCmd() { return new shaveIconCmd(); } MSyntax shaveIconCmd::createSyntax() { MSyntax syntax; syntax.enableEdit(false); syntax.enableQuery(true); syntax.addFlag(kNeedsReloadShort, kNeedsReloadLong, MSyntax::kString); return syntax; } MStatus shaveIconCmd::doIt(const MArgList& argList) { MStatus status; MArgDatabase args(syntax(), argList, &status); if (!status) return status; shaveGlobals::getGlobals(); if (args.isFlagSet(kNeedsReloadShort)) { MString iconFile; args.getFlagArgument(kNeedsReloadShort, 0, iconFile); setResult(shaveIcon::needsReload(iconFile)); } return status; }