#!/usr/bin/env php 1) { for($x = 1; $x < argc(); $x ++) { $r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d", intval(argv($x)), intval(local_channel()) ); if($r) echo jindent(json_encode($r[0])) . "\n"; } } else { $r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d order by abook_id", intval(local_channel()) ); if($r) { foreach($r as $rr) echo $rr['abook_id'] . "\t" . $rr['xchan_name'] . "\n"; } } break; default: break; } } function fresh_help() { if(argc() == 1) { echo "help - this text\n"; echo "login email_address - login with email_address, prompts for password\n"; // echo "finger channel_address - lookup channel_address remotely\n"; echo "channel new_channel - change active channel to new_channel (nickname)\n"; echo "conn [id1] [id2...] - without args list connections, or report detail of connection id1 (etc.)\n"; echo "quit|exit - terminate fresh\n"; } }