code: def write_validate(ctx, param, value):
      if value != ("default", "default"):
          try:
              mode, dest_file = (value[0], value[1])
          except IndexError:
              raise click.BadParameter('Expecting two arguments, one for how to '
                                       'output (s, single, m, multiple), and '
                                       'the second is a filepath where to put'
                                       ' the output.')
          if mode.lower() not in ['s', 'single', 'm', 'multiple']:
              raise click.BadParameter('The first argument of the -w/--write '
                                       'option must specifies whether to write'
                                       ' to one file per device, or all device'
                                       ' output to a single file. Valid options'
                                       ' are "s", "single", "m", and "multiple"')
          ctx.obj['out'] = (mode.lower(), dest_file)
      else:
          ctx.obj['out'] = None