Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

apply glob pattern via Path parameter. #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nayasis
Copy link

@nayasis nayasis commented Mar 18, 2021

ex.

$ java -jar /path/to/restcli.jar -e "test" glob:*.http

Copy link
Collaborator

@quangson91 quangson91 left a comment

Choose a reason for hiding this comment

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

@nayasis Thank you for the PR.
It almost looks great!
I just have some comments related to the code format.
If you have time, you can address these comments.
Otherwise, I will fix that then merge this PR.

Thanks!


fun String.glob(): List<String> {

if( ! this.startsWith("glob:") ) return listOf(this)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is better if we format code to make all the code same style.
On the Intellij Idea you can press Ctrl + Alt + L to format code.


val pattern = this.removePrefix("glob:")

var root = pattern
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perfer to use val than var if possible.

listOf(this)
}

}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should add blank line at the end of file to remove this warning from github.

(Some IDE has this setting. On Intellij IDEA, we have a setting: Ensure blank line at the end when save file).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants