anchor.diff:  -module(device_directory).
   -behaviour(gen_server).
   
  +-compile({parse_transform, lager_transform}).
  +
   %% API.
   -export([start_link/0]).
  +-export([list_devices/1]).
   
   %% gen_server.
   -export([init/1]).
  
positive.code: -export([terminate/2]).
  -export([code_change/3]).
  
  -export([parse_devices/0]).
  
  -record(state, {devices}).
  
  %% API.
  
negative.code: 
  get_devices() ->
    CMD = "tdtool --list-devices | awk 'BEGIN {FS=\" |=|\\t\"} NR == 1 {printf(\"[ \")} NR > 1 {printf(\"\\n ,\")}{printf(\" {device, %s, \\\"%s\\\"}\", $4,$6)} END {printf(\" ].\\n\")}'",
    lager:info("devices found: " ++ CMD),
    os:cmd(CMD).
  
  %% vim: tabstop=2 shiftwidth=2 expandtab
  