anchor.diff:  -author('feng@emqtt.io').
   
   -include("emqttd.hrl").
  +
   -include("emqttd_cli.hrl").
   
   %% CLI callbacks
  --export([cli_useradd/1, cli_userdel/1]).
  +-export([useradd/1, userdel/1]).
   
   -behaviour(emqttd_auth_mod).
   
  
positive.code: 		{disc_copies, [node()]},
  		{attributes, record_info(fields, ?AUTH_USERNAME_TAB)}]),
  	mnesia:add_table_copy(?AUTH_USERNAME_TAB, node(), ram_copies),
      emqttd_ctl:register_cmd(useradd, {?MODULE, cli_useradd}, []),
      emqttd_ctl:register_cmd(userdel, {?MODULE, cli_userdel}, []),
      {ok, Opts}.
  
  check(#mqtt_client{username = undefined}, _Password, _Opts) ->
  
negative.code: %%% CLI
  %%%=============================================================================
  
  useradd([Username, Password]) ->
      ?PRINT("~p~n", [add_user(list_to_binary(Username), list_to_binary(Password))]);
  
  useradd(_) ->
      ?PRINT_CMD("useradd <Username> <Password>", "add user").
  
  userdel([Username]) ->
      ?PRINT("~p~n", [remove_user(list_to_binary(Username))]);
  
  userdel(_) ->
      ?PRINT_CMD("userdel <Username>", "delete user").
  
  %%%=============================================================================
  %%% API 
  