https://github.com/t4zzlerdeveloper/intercmd
Simple Java Command Interperter Class -> A Easy-To-Use and Time-Saving solution
https://github.com/t4zzlerdeveloper/intercmd
Last synced: 8 months ago
JSON representation
Simple Java Command Interperter Class -> A Easy-To-Use and Time-Saving solution
- Host: GitHub
- URL: https://github.com/t4zzlerdeveloper/intercmd
- Owner: t4zzlerdeveloper
- Archived: true
- Created: 2021-10-30T09:22:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-28T20:04:31.000Z (over 4 years ago)
- Last Synced: 2024-12-19T13:11:09.873Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# interCMD (Very very badly optimized!!)
##### Simple Java Command Interperter Class
## Documentation:
- interCMD(Scanner scanner,String className);
- [ Initializes the command interperter, Scanner and className are optional ]
- addCommand(String command,String voidNameToRun);
- [ Add a new command and the function to be trigerred ]
- setExitCommand(String exitCommand);
- [ Change default "exit" command to a custom one ]
- run(int cycles)
- [ Run the command interperter, cycles is optional and can be used to specify the amount of commands to re read]
## Example:
```
public static void main(String[] args){
Scanner sr = new Scanner(System.in);
interCMD ic = new interCMD(sr);
ic.addCommand("hh","sayhello");
ic.setExitCommand("byebye");
ic.run();
}
public static void sayhello(){
System.out.println("Hello world");
}
```