code: def replace_argument(script, from_, to):
      
      replaced_in_the_end = re.sub(u' {}$'.format(re.escape(from_)), u' {}'.format(to),
                                   script, count=1)
      if replaced_in_the_end != script:
          return replaced_in_the_end
      else:
          return script.replace(
              u' {} '.format(from_), u' {} '.format(to), 1)
docs: Replaces command line argument.