#!/usr/bin/env node

/**
 * ./bin/gonzales.js filename
 * ./bin/gonzales.js filename -s
 */
var gonzales = require('..'),
    fs = require('fs'),
    filename = process.argv[2],
    silent = process.argv[3] === '-s';

if (!filename) {
  console.log('Please supply a filename. Usage "gonzales file"');
  process.exit();
}

try {
    var ast = gonzales.parse(fs.readFileSync(filename).toString());
    if (!silent) console.log(ast.toString());
} catch (e) {
    if (!silent) throw e;
}

@@ -135,24 +135,52 @@
 uire('fs'),%0A
+    path = require('path'),%0A
     filename
@@ -347,79 +347,161 @@
 %0A%7D%0A%0A
-try %7B%0A    var ast = gonzales.parse(fs.readFileSync(filename).toString()
+var syntax = path.extname(filename).substring(1);%0Avar css = fs.readFileSync(filename, 'utf-8');%0A%0Atry %7B%0A    var ast = gonzales.parse(css, %7Bsyntax: syntax%7D
 );%0A 

Use file extension as a syntax name