@Override
	public boolean applyTo(Program program) {

		ReferenceManager refMgr = program.getReferenceManager();

		if (!useOpIndex) {
			refMgr.removeAllReferencesFrom(fromAddr);
			return true;
		}

		Reference[] refs = refMgr.getReferencesFrom(fromAddr, opIndex);
		for (Reference ref : refs) {
			refMgr.delete(ref);
			RemoveReferenceCmd.fixupReferencedVariable(program, ref);
		}
		return true;
	}
Constructs a new command for removing all references.
@param fromAddr the address of the codeunit making the reference.
@param opIndex the operand index.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/refs/RemoveAllReferencesCmd.java