This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* (feat): issue templates based on CONTRIBUTION.md * (chore): vi does not behave the same with vim users☹️ * (feat): render struct * (feat): implementing controls * tab for complete (and complete the completion) * arrows to navigate between suggestions * cancel last suggestion to typed answer * keeping previous scenarios intact * (feat): usage example * (feat): add to readme * (fix): suggestions * (fix): tab and help on the same brackets * (feat): when tab with input suggestion, select next * (feat): select and multiselect cycle next with tab
- Loading branch information
1 parent
8780050
commit 52436f4
Showing
14 changed files
with
457 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
--- | ||
name: Ask for help | ||
about: Suggest an idea for this project or ask for help | ||
title: '' | ||
labels: 'Help Wanted' | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
This file contains 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: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: 'Bug' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**What operating system and terminal are you using?** | ||
|
||
**An example that showcases the bug.** | ||
|
||
**What did you expect to see?** | ||
|
||
**What did you see instead?** |
This file contains 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 @@ | ||
--- | ||
name: Others/suggestions | ||
about: Suggestions and other topics | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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,42 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
|
||
"github.com/AlecAivazis/survey/v2" | ||
) | ||
|
||
func suggestFiles(toComplete string) []string { | ||
files, _ := filepath.Glob(toComplete + "*") | ||
return files | ||
} | ||
|
||
// the questions to ask | ||
var q = []*survey.Question{ | ||
{ | ||
Name: "file", | ||
Prompt: &survey.Input{ | ||
Message: "Which file should be read?", | ||
Suggest: suggestFiles, | ||
Help: "Any file; do not need to exist yet", | ||
}, | ||
Validate: survey.Required, | ||
}, | ||
} | ||
|
||
func main() { | ||
answers := struct { | ||
File string | ||
}{} | ||
|
||
// ask the question | ||
err := survey.Ask(q, &answers) | ||
|
||
if err != nil { | ||
fmt.Println(err.Error()) | ||
return | ||
} | ||
// print the answers | ||
fmt.Printf("File chosen %s.\n", answers.File) | ||
} |
This file contains 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
Oops, something went wrong.