'''
Log out from binstar
'''

import getpass
from binstar_client.utils import get_binstar, remove_token

import logging
log = logging.getLogger('binstar.logout')

def main(args):

    bs = get_binstar()
    auth = bs.authentication()
    bs.remove_authentication(auth['id'])
    remove_token()
    log.info("logout successful")

def add_parser(subparsers):
    subparser = subparsers.add_parser('logout',
                                      help='Log out from binstar',
                                      description=__doc__)

    subparser.set_defaults(main=main)

@@ -223,24 +223,170 @@
 ntication()%0A
+    # TODO: named 'application' because I was using the github model%0A    # Change it to name once we release the latest version of binstar server%0A
     bs.remov
@@ -412,10 +412,19 @@
 th%5B'
-id
+application
 '%5D)%0A

remove token application, not name