added architecture and switched to CLICK implementation
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
# functions for commands needed
|
||||
# src/commands.py
|
||||
from pathlib import path
|
||||
# from pathlib import path
|
||||
import click
|
||||
|
||||
@click.command()
|
||||
def test():
|
||||
print("hello from test")
|
||||
|
||||
def Set_Challenge(comp: str, chal: str, setDirectory: bool):
|
||||
# set the current challenge and competition from input
|
||||
if state.current_comp != comp:
|
||||
|
||||
@@ -1,27 +1,11 @@
|
||||
# src/main.py
|
||||
# Parses and calls commands
|
||||
|
||||
import argparse
|
||||
from os import setregid
|
||||
from pathlib import Path
|
||||
from ctf.utils import *
|
||||
|
||||
def set_arguments():
|
||||
parser = argparse.ArgumentParser( #type:ignore
|
||||
prog="ctf",
|
||||
description="A collection of cli tools to improve your ctf workflow",
|
||||
epilog="")
|
||||
parser.add_argument('action') # positional argument, action to be taken
|
||||
parser.add_argument('-c', '--count') # option that takes a value
|
||||
parser.add_argument('-v', '--verbose', action='store_true') # on/off flag
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
||||
import ctf.commands as commands
|
||||
|
||||
|
||||
def main():
|
||||
args = set_arguments()
|
||||
print(args)
|
||||
commands.test()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user