Skip to content

Commit

Permalink
args moved to a function
Browse files Browse the repository at this point in the history
  • Loading branch information
c0m4r committed Jan 16, 2024
1 parent dea24ec commit 194d056
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,38 @@
import socket
import sys

# Parse Arguments
parser = argparse.ArgumentParser(
description="paranoya client",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("-p", help="Path to scan", metavar="PATH")
parser.add_argument(
"--host",
help="Target daemon host",
default="localhost",
)
parser.add_argument(
"--port",
help="Target daemon port",
default=1337,
)
parser.add_argument(
"--auth",
metavar="AUTHKEY",
help="Pass authkey if it is required",
)
parser.add_argument(
"--check",
action="store_true",
help="Check if path exists before it is sent",
default=False,
)
def parse_arguments() -> None:
# Parse Arguments
parser = argparse.ArgumentParser(
description="paranoya client",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("-p", help="Path to scan", metavar="PATH")
parser.add_argument(
"--host",
help="Target daemon host",
default="localhost",
)
parser.add_argument(
"--port",
help="Target daemon port",
default=1337,
)
parser.add_argument(
"--auth",
metavar="AUTHKEY",
help="Pass authkey if it is required",
)
parser.add_argument(
"--check",
action="store_true",
help="Check if path exists before it is sent",
default=False,
)

args = parser.parse_args()
return parser.parse_args()

args = parse_arguments()

if not args.p:
print("Missing -p path")
Expand Down

0 comments on commit 194d056

Please sign in to comment.