function value = getCommand(h,opt)

%   Copyright 2014 The MathWorks, Inc.

if nargin==1
    value = h.Command.getValue();
else
    if strcmpi( opt, 'object' )
        value = h.Command;
    elseif strcmpi( opt, 'value' )
        value = h.Command.getValue();
    elseif strcmpi( opt, 'macro' )
        value = h.Command.getMacro();
    elseif strcmpi( opt, 'token' )
        value = h.Command.getToken();
    end
end
end
