 registry.register(ListUpdatesCommand())
 registry.register(helpCommand)
 
+setbuf(__stdoutp, nil)
 registry.main(defaultVerb: helpCommand.verb, errorHandler: { error in
     fputs(error.description + "\n", stderr)
 })

    }
    
    func downloadQueue(queue: CKDownloadQueue, changedWithRemoval download: SSDownload!) {
        print("Finished: " + download.metadata.title)
    }
}


    func downloadQueue(queue: CKDownloadQueue, statusChangedForDownload download: SSDownload!) {
        if let activePhase = download.status.activePhase {
            let percentage = String(Int(floor(download.status.percentComplete * 100))) + "%"
//            let phase = String(activePhase.phaseType)
            print("\u{001B}[2K\r" + percentage + " " + download.metadata.title, appendNewline: false)
        }
    }
    
