The code would assume that a command with argc >= 3 would always be composed of <family name> <entity> <command> and thus "known-networks forget <ssid>" could not be executed. Instead of checking argc >= 3 check whether command->entity is non-NULL.