old_contents: #!/usr/bin/env python3                                                                                                                                         
  from cozify import hub
  import pprint, sys
  
  from cozify.test import debug
  
  def main(device):
      hub.device_toggle(device)
  
  if __name__ == "__main__":
      if len(sys.argv) > 1:
          main(sys.argv[1])
      else:
          sys.exit(1)
  
new_contents: #!/usr/bin/env python3                                                                                                                                         
  from cozify import hub
  import pprint, sys
  from absl import flags, app
  
  from cozify.test import debug
  
  FLAGS = flags.FLAGS
  
  flags.DEFINE_string('device', None, 'Device to operate on.')
  
  def main(argv):
      del argv
      hub.device_toggle(FLAGS.device)
  
  if __name__ == "__main__":
      flags.mark_flag_as_required('device')
      app.run(main)
  
subject: Convert device-toggle.py to use flags, --device now required