Last active
April 22, 2016 15:19
-
-
Save fmamud/155c9b4e5f851b05c89d81f2ba31abb9 to your computer and use it in GitHub Desktop.
Add unix ls command to groovysh
This file contains hidden or 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
// open groovysh | |
// execute :rc ls | |
import org.codehaus.groovy.tools.shell.CommandSupport | |
import org.codehaus.groovy.tools.shell.Groovysh | |
class Ls extends CommandSupport { | |
protected Ls(final Groovysh shell) { | |
super(shell, ':ls', ':dir') | |
} | |
public Object execute(List args) { | |
println "ls -l".execute().text | |
} | |
} |
This file contains hidden or 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
command.description=List all files on current directory | |
command.usage= | |
command.help=List all files on current directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment