diff --git a/cmd/main.go b/cmd/main.go index 8a69fb9..6fe7fc6 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -51,8 +51,8 @@ func main() { log.Fatalf("Error: %s", err) } } - if opts.ListQueryMatches { - _, err := assembuddy.QueryInfo(opts.Arch) + if opts.Arch != "" && opts.Syscall != "" { + _, err := assembuddy.GetSyscallData(opts.Arch, opts.Syscall, opts.PrettyPrint) if err != nil { log.Fatalf("Error: %s", err) } diff --git a/pkg/assembuddy/requestTable.go b/pkg/assembuddy/requestTable.go index 49e53cd..e1ee91a 100644 --- a/pkg/assembuddy/requestTable.go +++ b/pkg/assembuddy/requestTable.go @@ -52,7 +52,7 @@ func GetSyscallData(arch string, name string, prettyp bool) ([]Syscall, error) { url := "https://api.syscall.sh/v1/syscalls/" // if arch is x64, x86, arm, or arm64, concat to endpointURL if arch == "x64" || arch == "x86" || arch == "arm" || arch == "arm64" { - url += arch + url += arch + "/" // if arch is not empty, return error } else if arch != "" { return nil, errors.New("invalid architecture") @@ -65,14 +65,3 @@ func ArchInfo() ([]Syscall, error) { url := "https://api.syscall.sh/v1/conventions" return fetchData(url, true) } - -func QueryInfo(arch string) ([]Syscall, error) { - url := "https://api.syscall.sh/v1/syscalls/" - if arch == "x64" || arch == "x86" || arch == "arm" || arch == "arm64" { - url += arch - } else if arch != "" { - return nil, errors.New("invalid architecture") - } - return fetchData(url, true) - // TODO: -}