code: def main():
      
      parser = argparse.ArgumentParser()
      parser.add_argument('--backend', choices=['gatttool', 'bluepy', 'pygatt'], default='gatttool')
      parser.add_argument('-v', '--verbose', action='store_const', const=True)
      subparsers = parser.add_subparsers(help='sub-command help', )
  
      parser_poll = subparsers.add_parser('poll', help='poll data from a sensor')
      parser_poll.add_argument('mac', type=valid_miflora_mac)
      parser_poll.set_defaults(func=poll)
  
      parser_scan = subparsers.add_parser('scan', help='scan for devices')
      parser_scan.set_defaults(func=scan)
  
      parser_scan = subparsers.add_parser('backends', help='list the available backends')
      parser_scan.set_defaults(func=list_backends)
  
      args = parser.parse_args()
  
      if args.verbose:
          logging.basicConfig(level=logging.DEBUG)
  
      if not hasattr(args, "func"):
          parser.print_help()
          sys.exit(0)
  
      args.func(args)
docs: Main function.
  
      Mostly parsing the command line arguments.