-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added argcomplete to command line tools
- Loading branch information
1 parent
80351db
commit 0b9c2b7
Showing
10 changed files
with
54 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# PYTHON_ARGCOMPLETE_OK | ||
""" Generate human readable document describing the attack based on an attack log """ | ||
|
||
import argparse | ||
import argcomplete | ||
from app.doc_generator import DocGenerator | ||
|
||
DEFAULT_ATTACK_LOG = "removeme/loot/2021_09_08___07_41_35/attack.json" # FIN 7 first run on environment | ||
|
||
|
||
def create_parser(): | ||
""" Creates the parser for the command line arguments""" | ||
parser = argparse.ArgumentParser("Controls an experiment on the configured systems") | ||
lparser = argparse.ArgumentParser("Controls an experiment on the configured systems") | ||
|
||
parser.add_argument("--attack_log", default=DEFAULT_ATTACK_LOG, help="The attack log the document is based on") | ||
parser.add_argument("--outfile", default="tools/human_readable_documentation/source/contents.rst", help="The default output file") | ||
lparser.add_argument("--attack_log", default=DEFAULT_ATTACK_LOG, help="The attack log the document is based on") | ||
lparser.add_argument("--outfile", default="tools/human_readable_documentation/source/contents.rst", help="The default output file") | ||
|
||
return parser | ||
return lparser | ||
|
||
|
||
if __name__ == "__main__": | ||
arguments = create_parser().parse_args() | ||
parser = create_parser() | ||
argcomplete.autocomplete(parser) | ||
arguments = parser.parse_args() | ||
|
||
dg = DocGenerator() | ||
dg.generate(arguments.attack_log, arguments.outfile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ deps = -r requirements.txt | |
safety | ||
bandit | ||
pylint | ||
argcomplete | ||
|
||
|
||
commands = | ||
|