Skip to content

Instantly share code, notes, and snippets.

@samsonjs
Created May 12, 2010 17:46
Show Gist options
  • Save samsonjs/398883 to your computer and use it in GitHub Desktop.
Save samsonjs/398883 to your computer and use it in GitHub Desktop.
#!/usr/bin/env narwhal
// Usage: $ wtf-api file
// $ wtf-api file isDirectory rmtree
var args = require('system').args
, m = require(args[1])
if (args.length > 2)
args.slice(2).forEach(function(prop) {
if (prop in m)
print(prop + ': ' + m[prop])
else
print(args[1] + " doesn't have a property called " + prop)
})
else
for (var x in m) print(x + ': ' + m[x])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment