package cmd

import (
	"flag"
	"fmt"
)

func GetArguments() (string, string, string) {
	var UrlTarget string
	var Lhost string
	var Lport string

	flag.StringVar(&UrlTarget, "u", "", "The target URL (example: http://10.129.250.32)")
	flag.StringVar(&Lhost, "h", "", "Localhost (example: 10.10.14.10)")
	flag.StringVar(&Lport, "p", "", "The listening port for reverse shell (example: 4444)")

	flag.Parse()

	if UrlTarget == "" {
		fmt.Println("[*] Please provide the target URL (example: -u http://10.129.250.32)")
		flag.Usage()
		return "", "", ""
	}

	if Lhost == "" {
		fmt.Println("[*] Please provide your IP address (-h 10.10.14.10)")
		flag.Usage()
		return "", "", ""
	}

	if Lport == "" {
		fmt.Println("[*] Please provide the listening port for the reverse shell (-p 4444)")
		flag.Usage()
		return "", "", ""
	}

	return UrlTarget, Lhost, Lport
}
