Skip to content

Commit

Permalink
Merge pull request #2 from pry0cc/flags
Browse files Browse the repository at this point in the history
added flag library
  • Loading branch information
pry0cc authored Mar 15, 2022
2 parents d68c519 + cc34da0 commit 9931b03
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
package main

import (
"flag"
"fmt"
"github.com/n0ncetonic/nmapxml"
"os"
)

func main() {
input := os.Args[1]
var inputArg = flag.String("x", "", "Nmap XML Input File (Required)")
var dnsxArg = flag.String("dnsx", "", "dnsx -resp output data (TODO)")
flag.Parse()

input := *inputArg
dnsx := *dnsxArg

if input == "" {
flag.PrintDefaults()
os.Exit(1)
}

if dnsx != "" {
if _, err := os.Stat(dnsx); err != nil {
fmt.Printf("dnsx file does not exist\n")
}
}

if _, err := os.Stat(input); err != nil {
fmt.Printf("File does not exist\n")
}

scanData, _ := nmapxml.Readfile(input)
ParseNmap(scanData)
}
Expand Down

0 comments on commit 9931b03

Please sign in to comment.