Skip to content

Commit

Permalink
Sort listed attack types and improve visual display of the descriptio…
Browse files Browse the repository at this point in the history
…n (word wrap it)
  • Loading branch information
vitaly-ps committed Apr 16, 2024
1 parent 1b43a50 commit 6726cf8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ps_fuzz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .interactive_mode import interactive_shell
from .prompt_injection_fuzzer import run_fuzzer
from .logo import print_logo
from .util import wrap_text

# Initialize colorama
colorama.init()
Expand Down Expand Up @@ -43,8 +44,8 @@ def main():
attack_config = AttackConfig(FakeChatClient(), 1)
tests = instantiate_tests(client_config, attack_config)
print("Available attacks:")
for test_name, test_description in [(cls.test_name, cls.test_description) for cls in tests]:
print(f" {BRIGHT}{test_name}{RESET}: {test_description}")
for test_name, test_description in sorted([(cls.test_name, cls.test_description) for cls in tests]):
print(f"{BRIGHT}{test_name}{RESET}:\n{wrap_text(test_description)}")
sys.exit(0)

# Setup debug level (default 1)
Expand Down

0 comments on commit 6726cf8

Please sign in to comment.