Skip to content

Commit

Permalink
removed listarch
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Nov 28, 2023
1 parent 1e62a94 commit ec927b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
18 changes: 2 additions & 16 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ func parseArgs() *assembuddy.CLIOptions {
query := parser.String("q", "query", &argparse.Options{Help: "Search query"})
arch := parser.String("a", "architecture", &argparse.Options{Help: "Architecture for queries"})

listArch := parser.Flag("r", "list-arch", &argparse.Options{Help: "Get all supported architecture convensions"})

prettyPrint := parser.Flag("p", "pretty-print", &argparse.Options{Help: "Pretty print JSON result"})

err := parser.Parse(os.Args)
if err != nil || (*query == "" && *arch == "") && !*listArch {
if err != nil || (*query == "" && *arch == "") {
fmt.Print(parser.Usage(err))
os.Exit(1)
}
opts.Syscall = *query
opts.Arch = *arch
opts.ListArch = *listArch
opts.PrettyPrint = *prettyPrint

return opts
Expand All @@ -36,18 +33,7 @@ func parseArgs() *assembuddy.CLIOptions {
func main() {
opts := parseArgs()

if opts.ListArch {
listArch()
} else {
syscallData(opts)
}
}

func listArch() {
_, err := assembuddy.ArchInfo()
if err != nil {
log.Fatalf("Error: %v", err)
}
syscallData(opts)
}

func syscallData(opts *assembuddy.CLIOptions) {
Expand Down
4 changes: 0 additions & 4 deletions pkg/assembuddy/requestTable.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,3 @@ func GetSyscallData(opts *CLIOptions) (string, error) {
}
return url, nil
}

func ArchInfo() ([]Syscall, error) {
return FetchData(conventionEndpoint)
}

0 comments on commit ec927b4

Please sign in to comment.