-
Notifications
You must be signed in to change notification settings - Fork 1
HW01 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ZinovyevaAnna
wants to merge
16
commits into
main
Choose a base branch
from
hw01
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
HW01 #4
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f96dcd1
add grep command
ZinovyevaAnna c8fd1cf
add tests
ZinovyevaAnna cf01396
add comments
ZinovyevaAnna 33f7668
add assignments
ZinovyevaAnna 119060f
update readme
ZinovyevaAnna b694206
Setup workflow file for GitHub actions.
ZinovyevaAnna 9a1ae7c
Setup workflow file for GitHub actions.
ZinovyevaAnna e7408b8
no grep :)
ZinovyevaAnna 2a3adab
fix multiple $ substitutions
ZinovyevaAnna 260ae77
fix wc
ZinovyevaAnna 5ab0470
fix pwd
ZinovyevaAnna 55fb90a
remove command constructor
ZinovyevaAnna 105b74d
update run instructions
ZinovyevaAnna c823875
add abstract factory and reorganize tests
ZinovyevaAnna 33ec1d1
fix null when no env var
ZinovyevaAnna 9f7155b
add editor config and gitignore
ZinovyevaAnna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = 4 | ||
| indent_style = space | ||
| insert_final_newline = false | ||
| max_line_length = 120 | ||
| tab_width = 8 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: CI | ||
| on: [push] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v2 | ||
| with: | ||
| java-version: 17 | ||
| distribution: 'adopt' | ||
| - name: Build with Gradle | ||
| run: ./gradlew build | ||
| - name: Test with Gradle | ||
| run: ./gradlew test |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| build | ||
| .gradle | ||
| .idea |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,25 @@ | ||
| # sd-homework | ||
| # simplecli | ||
|
|
||
| ### How to run | ||
|
|
||
| Run [main](src/main/java/ru/itmo/simplecli/Main.java) | ||
| method from IDE **or** `./gradlew run`. | ||
|
|
||
| ### What's there | ||
|
|
||
| Implemented build-ins: | ||
| - [cat](src/main/java/ru/itmo/simplecli/executor/commands/Cat.java) | ||
| - [echo](src/main/java/ru/itmo/simplecli/executor/commands/Echo.java) | ||
| - [exit](src/main/java/ru/itmo/simplecli/executor/commands/Exit.java) | ||
| - [pwd](src/main/java/ru/itmo/simplecli/executor/commands/Pwd.java) | ||
| - [wc](src/main/java/ru/itmo/simplecli/executor/commands/WC.java) | ||
| - [variable assignment](src/main/java/ru/itmo/simplecli/executor/commands/Assignment.java) | ||
|
|
||
| [Main](src/main/java/ru/itmo/simplecli/Main.java) runs loop until `exit` command is given. | ||
| If the entered string contains incomplete quotes, it asks to continue typing. | ||
|
|
||
| [Parser](src/main/java/ru/itmo/simplecli/executor/Parser.java) supports double and single quotes. | ||
| It also performs substitution for values beginning with `$` if it is not surrounded by single quotes. | ||
|
|
||
| The CLI [supports](src/main/java/ru/itmo/simplecli/executor/PipedCommand.java) a pipeline of commands, separated by a sign `|`, | ||
| each command receives as input the output of the previous one. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| plugins { | ||
| application | ||
| } | ||
|
|
||
| application { | ||
| mainClass.set("ru.itmo.simplecli.Main") | ||
| } | ||
|
|
||
| group = "ru.itmo" | ||
| version = "1.0" | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation("commons-cli:commons-cli:1.5.0") | ||
| testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") | ||
| testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") | ||
| } | ||
|
|
||
| java { | ||
| toolchain { | ||
| languageVersion.set(JavaLanguageVersion.of(17)) | ||
| } | ||
| } | ||
|
|
||
| tasks.test { | ||
| useJUnitPlatform() | ||
| } | ||
|
|
||
| tasks.named<JavaExec>("run") { | ||
| standardInput = System.`in` | ||
| } |
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| rootProject.name = "simplecli" | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не хватает только инструкции по запуску.
-0.5.