https://github.com/kennykarnama/personal-cli
https://github.com/kennykarnama/personal-cli
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kennykarnama/personal-cli
- Owner: kennykarnama
- Created: 2022-10-08T04:44:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-09T09:14:45.000Z (over 2 years ago)
- Last Synced: 2025-01-24T17:16:45.423Z (4 months ago)
- Language: Java
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## personal-cli
Simple cli using java
## Tech stacks
- Maven
- Java
- picocli## Commands
To see all the commands, run
```
personal-cli --help
```### alphabetSoup
Sort strings alphabetically
I provide two implementations
- Bubble sort
- Counting sortThe way I organize this is by using abstract class and subclass that implements the function
```
AbstractClass AlphabetSoup- inputStr: String
- validate() throws Exception // concrete implementation
+ process() String
```Each of different implementation will override `process` methods
Command
```
Usage: personal-cli alphabet-soup --input-str= [-m=]
sort alphabetically
--input-str=-m, --mode= Sort mode, DEFAULT (use bubble sort), COUNTING_SORT
```## How to run
### Docker
- Build the image
```
docker build . -t personal-cli
```- run image and pass the arguments
```
docker run personal-cli [subcommand] [args]
```#### alphabet-soup
```
docker run personal-cli alphabet-soup --input-str=dolgado
```## Local Development
- Make sure you have installed java & maven
- in the root of project
- mvn clean install