def main():
    parser = OptionParser(usage="%prog")
    parser.add_option("-l",
                      "--list",
                      dest="list",
                      action="store_true",
                      default=False,
                      help="List installed profiles")
    parser.add_option("-i",
                      "--install",
                      dest="install",
                      action="store",
                      metavar="FILE",
                      help="Install profile")
    parser.add_option("-r",
                      "--remove",
                      dest="remove",
                      action="store",
                      metavar="IDENTIFIER",
                      help="Remove profile")
    (options, args) = parser.parse_args()

    if not options.list and not options.install and not options.remove:
        parser.print_help()
        return
    lockdown = LockdownClient()
    mc = MobileConfigService(lockdown)

    if options.list:
        pprint(mc.GetProfileList())
    elif options.install:
        mc.InstallProfile(read_file(options.install))
    elif options.remove:
        pprint(mc.RemoveProfile(options.remove))
def main():
    parser = OptionParser(usage="%prog")
    parser.add_option("-l", "--list", dest="list", action="store_true",
                      default=False, help="List installed profiles")
    parser.add_option("-i", "--install", dest="install", action="store",
                  metavar="FILE", help="Install profile")
    parser.add_option("-r", "--remove", dest="remove", action="store",
                  metavar="IDENTIFIER", help="Remove profile")
    (options, args) = parser.parse_args()

    if not options.list and not options.install and not options.remove:
        parser.print_help()
        return
    lockdown = LockdownClient()
    mc = MobileConfigService(lockdown)

    if options.list:
        pprint(mc.GetProfileList())
    elif options.install:
        mc.InstallProfile(read_file(options.install))
    elif options.remove:
        pprint(mc.RemoveProfile(options.remove))