docs: def run():  #pylint: disable=too-many-locals
      """Execute the command loop
      """
      store = EventStore(STORE_PATH)
      with open(CREDENTIAL_PATH, 'r') as cred_file:
          creds = json.load(cred_file)
          uname, pword = creds['uname'], creds['pword']
      mgr = KindleProgressMgr(store, uname, pword)
  
      print 'Detecting updates to Kindle progress:'
      events = mgr.detect_events()
      if events is None:
          print 'Failed to retrieve Kindle progress updates'
          return
      elif not events:
          print '  No updates detected'
      else:
          for event in events:
              print '  ' + str(event)
  
      print
      print 'Finished updating.'
      print 'Mark new books as \'reading\' or old books as \'read\'? (y/N)'
      if safe_raw_input('> ') == 'y':
          _change_state_prompt(mgr)
      mgr.commit_events()