Skip to content

Commit

Permalink
one thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Nov 16, 2023
1 parent d03830e commit a25faa1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 56 deletions.
7 changes: 3 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ package main

import (
"fmt"
"log"
"os"

"github.com/Selyss/chtsht/pkg/chtsht"

Check failure on line 8 in cmd/main.go

View workflow job for this annotation

GitHub Actions / build

no required module provides package github.com/Selyss/chtsht/pkg/chtsht; to add it:
"github.com/akamensky/argparse"
// tea "github.com/charmbracelet/bubbletea"
"log"
"os"
)

func main() {

parser := argparse.NewParser("cued", "Tool for querying programming keywords")
topic := parser.String("p", "program", &argparse.Options{Required: false, Help: "Program to query", Default: ""})
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))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/Selyss/chtsht
module github.com/Selyss/Assembuddy

go 1.21.3

Expand Down
4 changes: 1 addition & 3 deletions pkg/assembuddy/asm.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chtsht
package assembuddy

import (
"encoding/json"
Expand Down Expand Up @@ -69,7 +69,6 @@ func getSyscalls(arch string) ([]string, error) {

body, err := io.ReadAll(resp.Body)
if err != nil {

return nil, err
}

Expand Down Expand Up @@ -98,7 +97,6 @@ func getSyscallDetails(arch, name string) (*Syscall, error) {
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err

}

var syscalls []Syscall
Expand Down
6 changes: 3 additions & 3 deletions pkg/assembuddy/commands.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package chtsht
package assembuddy

import (
"bufio"
tea "github.com/charmbracelet/bubbletea"
"log"
"os"
"os/exec"
"strings"

tea "github.com/charmbracelet/bubbletea"
)

func SelectFromList(items []string) (string, error) {
Expand Down Expand Up @@ -52,7 +53,6 @@ func DisplayOutput(url string) {

func ChtReadOptions() ([]string, error) {
readFile, err := os.Open("chtsht.txt") // TODO:

if err != nil {
return nil, err
}
Expand Down
39 changes: 0 additions & 39 deletions pkg/assembuddy/config.go

This file was deleted.

5 changes: 3 additions & 2 deletions pkg/assembuddy/spinner.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package chtsht
package assembuddy

import (
"fmt"
"os"

"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"os"
)

type errMsg error
Expand Down
7 changes: 3 additions & 4 deletions pkg/assembuddy/syscall.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package chtsht
package assembuddy

import (
"encoding/json"
"fmt"
"github.com/olekukonko/tablewriter"
"log"
"os"

"github.com/olekukonko/tablewriter"
)

func DisplaySyscall(syscallJSON []byte) {
Expand Down Expand Up @@ -44,7 +45,6 @@ func DisplaySyscall(syscallJSON []byte) {
tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiYellowColor},
tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiYellowColor})
} else if arch == "x86" {

} else if arch == "arm64" {
table.SetHeaderColor(tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor},
tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor},
Expand All @@ -56,7 +56,6 @@ func DisplaySyscall(syscallJSON []byte) {
tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor},
tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor},
tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor})

} else if arch == "arm" {
table.SetHeaderColor(tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiMagentaColor},
tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiMagentaColor},
Expand Down

0 comments on commit a25faa1

Please sign in to comment.