2015-07-11 10:30:30 +00:00
|
|
|
//
|
|
|
|
// main.swift
|
|
|
|
// mas-cli
|
|
|
|
//
|
|
|
|
// Created by Andrew Naylor on 11/07/2015.
|
|
|
|
// Copyright © 2015 Andrew Naylor. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
2015-08-02 20:38:38 +00:00
|
|
|
var downloadQueue = CKDownloadQueue.sharedDownloadQueue()
|
2015-08-21 13:02:36 +00:00
|
|
|
downloadQueue.addObserver(DownloadQueueObserver())
|
2015-08-02 20:38:38 +00:00
|
|
|
|
|
|
|
let registry = CommandRegistry<MASError>()
|
|
|
|
let helpCommand = HelpCommand(registry: registry)
|
|
|
|
registry.register(AccountCommand())
|
|
|
|
registry.register(InstallCommand())
|
2015-08-02 21:42:01 +00:00
|
|
|
registry.register(ListInstalledCommand())
|
2015-08-02 20:38:38 +00:00
|
|
|
registry.register(ListUpdatesCommand())
|
|
|
|
registry.register(helpCommand)
|
|
|
|
|
|
|
|
registry.main(defaultVerb: helpCommand.verb, errorHandler: { error in
|
|
|
|
fputs(error.description + "\n", stderr)
|
|
|
|
})
|
2015-07-11 10:30:30 +00:00
|
|
|
|