Created
February 21, 2014 14:02
-
-
Save anonymous/9134774 to your computer and use it in GitHub Desktop.
A set of shell JVM commands for CRaSH http://try.crashub.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Class based commands using annotations | |
class dir { | |
@Usage("show the current directory") | |
@Command | |
void main(@Usage("the dir to list") @Argument String path) { | |
File dir = path != null ? new File(path) : new File("."); | |
def files = dir.listFiles(); | |
files.each { file -> | |
context.provide(NAME:file.name,LENGTH:file.length(),DATE:new Date(file.lastModified())) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment