#!/usr/bin/env python

import sys
from lpltk import LaunchpadService

#lp   = LaunchpadService(config={'read_only':True})
lp   = LaunchpadService()

if len(sys.argv) < 2:
    print "Usage:  similar-bugs [bug-id]"
    sys.exit(2)
bug_id = sys.argv[1]

bug = lp.launchpad.bugs[bug_id]
for dupe in bug.bug_tasks[0].findSimilarBugs():
    print "%12d %s" %(dupe.id, dupe.title)

