Skip to content

grep#2

Open
tretikoff wants to merge 5 commits into
solutionfrom
grep-command
Open

grep#2
tretikoff wants to merge 5 commits into
solutionfrom
grep-command

Conversation

@tretikoff
Copy link
Copy Markdown
Owner

No description provided.

@tretikoff tretikoff force-pushed the solution branch 2 times, most recently from e9ab00a to 386fa0c Compare February 17, 2021 13:23
@tretikoff tretikoff force-pushed the solution branch 5 times, most recently from 31bf5b7 to fbcb94e Compare February 25, 2021 13:23
@tretikoff tretikoff force-pushed the grep-command branch 2 times, most recently from ff21afe to 047f1f0 Compare February 26, 2021 15:08
Copy link
Copy Markdown
Collaborator

@FirstTimeInForever FirstTimeInForever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отказывается принимать ключи:

$grep -A 10 test README.md
Feb 27, 2021 9:10:45 PM ru.tretikoff.Shell run
INFO: grep -A 10 test README.md
Feb 27, 2021 9:10:45 PM ru.tretikoff.Parser splitByQuotes
INFO: parsing grep -A 10 test README.md from the -1 to the -1
Feb 27, 2021 9:10:45 PM ru.tretikoff.Parser parse
INFO: Splitted grep -A 10 test README.md by quotes [grep -A 10 test README.md]
Feb 27, 2021 9:10:45 PM ru.tretikoff.Parser parse
INFO: Splitted grep -A 10 test README.md into [grep, -A, 10, test, README.md]
Feb 27, 2021 9:10:45 PM ru.tretikoff.Shell run
INFO: grep, -A, 10, test, README.md
Feb 27, 2021 9:10:45 PM ru.tretikoff.words.Word substituteVariables
INFO: sadg
Feb 27, 2021 9:10:45 PM ru.tretikoff.words.Word substituteVariables
INFO: sadg
Feb 27, 2021 9:10:45 PM ru.tretikoff.words.Word substituteVariables
INFO: sadg
Feb 27, 2021 9:10:45 PM ru.tretikoff.words.Word substituteVariables
INFO: sadg
Feb 27, 2021 9:10:45 PM ru.tretikoff.words.Word substituteVariables
INFO: sadg
Feb 27, 2021 9:10:45 PM ru.tretikoff.Shell run
SEVERE: grep: unrecognized option '-A'
grep: unrecognized option '-A'

По заданию нужно ещё поддерживать поиск по regex (достаточно делать это по ключу -e). Добавьте пожалуйста regex, поправьте аргументы и CI.

Comment thread src/main/kotlin/ru/tretikoff/commands/GrepCommand.kt Outdated
Comment thread src/test/kotlin/GrepTest.kt Outdated
@tretikoff
Copy link
Copy Markdown
Owner Author

tretikoff commented Mar 1, 2021

@FirstTimeInForever я думал что поддерживать регулярные выражения нужно без специальных ключей. Они добавлены, на это даже тесты есть. Тем более в задании про ключ -e ничего не сказано, сказано поддержать регулярки в строке поиска

С ключами прошу прощения, после ребейза перестали некоторые работать, поэтому тесты завалились (плюс подразумевалось использование ключа как -A10, переделал чтобы -A 10 тоже работало)

@tretikoff tretikoff force-pushed the grep-command branch 4 times, most recently from 32b473e to 706f5d5 Compare March 2, 2021 07:09
Copy link
Copy Markdown
Collaborator

@FirstTimeInForever FirstTimeInForever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зависает на пайпе: $cat README.md | grep grep.

@tretikoff
Copy link
Copy Markdown
Owner Author

Да, действительно, читал из нового ConsoleStream вместо inputStream, из-за этого pipe не работал. Исправил

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants