forked from Drive-for-Java/MyCMD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommand.java
More file actions
31 lines (27 loc) · 966 Bytes
/
Copy pathCommand.java
File metadata and controls
31 lines (27 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.mycmd;
import java.io.IOException;
/**
* Represents a shell command that can be executed inside the MyCMD shell. Implementations perform
* their operation when {@link #execute(String[], ShellContext)} is called.
*/
public interface Command {
/**
* Execute the command.
*
* @param args command-line style arguments passed to the command. May be empty but will not be
* null.
* @param context current shell context containing state such as the current working directory.
* @throws IOException if the command cannot complete successfully.
*/
void execute(String[] args, ShellContext context) throws IOException;
/**
* Short description of the command. Default is empty so existing implementations do not break.
*/
default String description() {
return "";
}
/** Usage string for the command. Default is empty. */
default String usage() {
return "";
}
}