Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Nov 16, 2023
1 parent 0ce58c4 commit 3a07c62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func main() {
query := parser.String("q", "query", &argparse.Options{Required: false, Help: "Query", Default: ""})
err := parser.Parse(os.Args)

// TODO: refactor so we have one output no matter what and a set input place so i can wrap with a spinner
if err != nil {
fmt.Print(parser.Usage(err))
return
Expand Down
5 changes: 2 additions & 3 deletions pkg/chtsht/spinner.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type model struct {
func initialModel() model {
s := spinner.New()
s.Spinner = spinner.Dot
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("99"))
return model{spinner: s}
}

Expand Down Expand Up @@ -55,13 +55,12 @@ func (m model) View() string {
}
str := fmt.Sprintf("\n %s Loading information...press q to quit\n", m.spinner.View())
if m.quitting {
return str + "\n"
return ""
}
return str
}

func DisplayLoadingSpinner(p *tea.Program) {

if _, err := p.Run(); err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down

0 comments on commit 3a07c62

Please sign in to comment.