<?php

if ($argc < 4) {
    fprintf(STDERR, "Usage: swfreplaceeditstring <swf_file> <variable_name> <initial_text>\n");
    exit(1);
}

$swf_filename = $argv[1];
$variable_name = $argv[2];
$initial_text = $argv[3];
$swfdata = file_get_contents($swf_filename);

$obj = new SWFEditor();
$obj->input($swfdata);
$obj->replaceEditString($variable_name, $initial_text);

echo $obj->output();
