fixed filename index on command-line
added JavaScript output format
removed trailing spaces