Skip to content

Commit ab0a84e

Browse files
Added --no-interaction option
1 parent 68329b3 commit ab0a84e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,21 @@ But you can define the parameters yourself:
6767
-i, --without-issues Exclude issues from processing
6868
-s, --without-pulls Exclude Pull Requests from processing
6969
-o, --with-open Process including open Issues and Pull Requests
70+
-n, --no-interaction Do not ask any interactive question
7071
```
7172

7273
For example:
7374

7475
```Bash
7576
# without issues + with open
76-
notifications read qwerty -io
77+
notifications read qwerty -ion
7778
```
7879

7980
With this set of options, notifications that have:
8081

8182
- whose repository name begins with the word `qwerty`
8283
- Pull Requests only, both open and closed
84+
- will not be asked to continue in the console
8385

8486
## Support Us
8587

app/Commands/ReadCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ReadCommand extends Command
1717
. ' {--i|without-issues : Exclude issues from processing}'
1818
. ' {--s|without-pulls : Exclude Pull Requests from processing}'
1919
. ' {--o|with-open : Process including open Issues and Pull Requests}'
20+
. ' {--n|no-interaction : Do not ask any interactive question}'
2021
. ' {--token= : GitHub access token with "notifications" permissions}';
2122

2223
protected $description = 'Read all issue notifications';
@@ -39,7 +40,7 @@ protected function welcome(?string $repository): void
3940

4041
protected function hasContinue(): bool
4142
{
42-
return confirm('Continue');
43+
return $this->noInteraction() || confirm('Continue');
4344
}
4445

4546
protected function read(?string $repository): void
@@ -100,6 +101,11 @@ protected function withOpen(): bool
100101
return $this->option('with-open');
101102
}
102103

104+
protected function noInteraction(): bool
105+
{
106+
return $this->option('no-interaction');
107+
}
108+
103109
protected function token(): string
104110
{
105111
if ($token = $this->detectToken()) {

0 commit comments

Comments
 (0)