anchor.diff:  
   -include("emqttd_cli.hrl").
   
  --export([init/0,
  +-behaviour(gen_server).
  +
  +-define(SERVER, ?MODULE).
  +
  +%% API Function Exports
  +-export([start_link/0,
            register_cmd/3,
            unregister_cmd/1,
            run/1]).
   
  --export([status/1,
  -         vm/1,
  -         stats/1,
  -         metrics/1,
  -         cluster/1,
  -         clients/1,
  -         sessions/1,
  -         listeners/1,
  -         bridges/1]).
  +%% gen_server Function Exports
  +-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
  +         terminate/2, code_change/3]).
  +
  +-record(state, {seq = 0}).
   
   -define(CMD_TAB, mqttd_ctl_cmd).
   
  
positive.code: %%------------------------------------------------------------------------------
  -spec register_cmd(atom(), {module(), atom()}, list()) -> true.
  register_cmd(Cmd, MF, Opts) ->
      ets:insert(?CMD_TAB, {Cmd, MF, Opts}).
  
  %%------------------------------------------------------------------------------
  %% @doc Unregister a command
  
negative.code: %%------------------------------------------------------------------------------
  -spec unregister_cmd(atom()) -> true.
  unregister_cmd(Cmd) ->
      gen_server:cast(?SERVER, {unregister_cmd, Cmd}).
  
  %%------------------------------------------------------------------------------
  %% @doc Run a command
  %% @end
  %%------------------------------------------------------------------------------
  run([]) -> usage();
  
  run(["help"]) -> usage();
  
  run([CmdS|Args]) ->
      Cmd = list_to_atom(CmdS),
      case ets:match(?CMD_TAB, {{'_', Cmd}, '$1', '_'}) of
          [[{Mod, Fun}]] -> Mod:Fun(Args);
          [] -> usage() 
      end.
      
  