Last active
December 28, 2015 09:19
-
-
Save etexier/7477994 to your computer and use it in GitHub Desktop.
A sample command
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
| /* | |
| * Copyright (c) 2013 Magnet Systems, Inc. All rights reserved. | |
| */ | |
| package com.magnet.tools.cli.test | |
| import com.magnet.tools.cli.AbstractCommand | |
| import com.magnet.tools.cli.Constants | |
| /** | |
| * Test command to verify that we can install new commands dynamically | |
| */ | |
| class TestCommand extends AbstractCommand { | |
| TestCommand() { | |
| // set name, usage, and short help (for help tool) | |
| super('test-command', 'test-command -v', 'this is test command') | |
| } | |
| @Override | |
| def execute(List<String> args) { | |
| writer.println("this is a sample magnet command with arguments ${args}") | |
| shell << "x curl -k -u 'magnet:password' https://localhost:8080/rest/hello?param0=${args[0]}" | |
| getWriter().println() | |
| return Constants.COMMAND_OK_CODE | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment