Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Suggest an image if entered word length is greater than 2 #16

Merged
merged 3 commits into from
Feb 15, 2020
Merged

Suggest an image if entered word length is greater than 2 #16

merged 3 commits into from
Feb 15, 2020

Conversation

selcukusta
Copy link
Contributor

Description

  • I've re-enabled it suggestions of most pulled images from Hub API.

  • The suggester will be fired if the entered keyword length is greater than 2.

  • I've removed if len(completer.([]prompt.Suggest)) > 0 statement (line 127). If the entered keyword is 01013fd and there's no image with this, the shell will be caching it to prevent send the invalid requests again.

  • A little refactoring.

Screenshot

asciicast

Copy link
Member

@mstrYoda mstrYoda left a comment

Choose a reason for hiding this comment

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

Thank you for your pr.

We can suggest images after 2 character typed 👍

Please check the comments.

Also can you squash your commits after your changes?

mstrYoda and others added 2 commits February 5, 2020 10:37
… Http retry is implemented. Prevent image suggestion after selection of any.
@@ -157,9 +171,17 @@ func completer(d prompt.Document) []prompt.Suggest {
}

if command == "pull" {
if strings.Index(word, ":") != -1 || strings.Index(word, "@") != -1 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've found a bug and tried to solve that. If the user entered a tag or digest, the search was running.

@mstrYoda mstrYoda merged commit ac3c283 into Trendyol:master Feb 15, 2020
@mstrYoda
Copy link
Member

Merged, thanks 👍

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.

2 participants