Method code for $has_commands.add_shortcut()

[Turn off line numbering]
  1: arg shortcut, template, method;
  2: var relation;
  3: 
  4: (> .perms(sender()) <);
  5: if (type(shortcut) != 'string || type(template) != 'string)
  6:     throw(~type, "Both shortcut and template must be strings.");
  7: if (type(method) != 'symbol)
  8:     throw(~type, "Method must be submitted as a symbol.");
  9: relation = (> $command_lib.parse_relation(shortcut, template) <);
 10: shortcut = relation[1][1];
 11: relation = relation[2][2];
 12: if (!shortcuts)
 13:     shortcuts = #[];
 14: shortcuts = shortcuts.add(shortcut, [method, relation]);

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon