def check_opts(choice):
 choice_opts = choice.split(' ')
 if (len(choice_opts) == 1):
  if (type(choice) is int):
   return choice
  elif ('help' in choice):
   help()
   choice = (-1)
  elif ('gops' in choice):
   config.dump()
   choice = (-1)
  elif (('quit' in choice) or ('exit' in choice)):
   os._exit(1)
  elif ('bg' in choice):
   background()
 elif ('set' in choice_opts[0]):
  opts = choice.split(' ')
  if ((opts[1] is None) or (opts[2] is None)):
   return
  print ((((((('[!] Setting ' + color.YELLOW) + ('%s' % opts[1])) + color.END) + '-> ') + color.GREEN) + ('%s..' % opts[2])) + color.END)
  config.set(opts[1], opts[2])
  choice = (-1)
 return choice

def check_opts ( choice ) : choice_opts = choice . split ( ' ' ) if ( len ( choice_opts ) == 1 ) : if ( type ( choice ) is int ) : return choice elif ( 'help' in choice ) : help ( ) choice = ( - 1 ) elif ( 'gops' in choice ) : config . dump ( ) choice = ( - 1 ) elif ( ( 'quit' in choice ) or ( 'exit' in choice ) ) : os . _exit ( 1 ) elif ( 'bg' in choice ) : background ( ) elif ( 'set' in choice_opts [ 0 ] ) : opts = choice . split ( ' ' ) if ( ( opts [ 1 ] is None ) or ( opts [ 2 ] is None ) ) : return print ( ( ( ( ( ( ( '[!] Setting ' + color . YELLOW ) + ( '%s' % opts [ 1 ] ) ) + color . END ) + '-> ' ) + color . GREEN ) + ( '%s..' % opts [ 2 ] ) ) + color . END ) config . set ( opts [ 1 ] , opts [ 2 ] ) choice = ( - 1 ) return choice
parse up the user input and run whatever commands are needed .