from pentest.command import JarvisCmd
import sys
__name__ = "nmap"


def main():
	args_config = {
		"passthrough_args": ["-oA", "-oX", "-oG", "-oS", "-oN", "-h", "--help"],
		"output_args": [
			{
				"format": None,
				"arg": "-oA"
			}
		]
	}

	cmd = JarvisCmd(sys.argv)
	cmd.set_args_config(args_config)

	for arg in cmd.args:
		if "--tag" in arg:
			target = cmd.args[cmd.args.index("--tag") + 1]
			del(cmd.args[cmd.args.index("--tag") + 1])
			del(cmd.args[cmd.args.index("--tag")])
			break
		elif "-iL" in arg:
			target = "multiple-hosts"
			break
	else:
		target = cmd.args[-1].replace('/', '_')

	cmd.run(target)
