diff --git a/README.md b/README.md index d85817e..0556663 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,9 @@ python run_tests.py -q python run_tests.py --pattern=banner ``` +The GUI help dialog also mentions the launcher version flag and the targeted +test-run pattern so you can find them quickly from inside the app. + CI is configured via GitHub Actions to run the shared `run_tests.py` entrypoint. ## Banner detection diff --git a/main.py b/main.py index 120132c..39f9117 100644 --- a/main.py +++ b/main.py @@ -7,9 +7,11 @@ def main(): + """Start the Tkinter GUI launcher.""" import tkinter as tk parser = argparse.ArgumentParser( + prog="python main.py", description="Launch the Port Scanner GUI", epilog="Use --version to print the installed app version and exit.", ) diff --git a/portscanner/__init__.py b/portscanner/__init__.py index ffcfe59..5cbf72e 100644 --- a/portscanner/__init__.py +++ b/portscanner/__init__.py @@ -1,3 +1,5 @@ +"""Public package exports for the port scanner app.""" + __version__ = "0.2.1" @@ -9,6 +11,7 @@ def get_version() -> str: from .utils import export_to_file, copy_to_clipboard from .gui import PortScannerApp +# Keep the top-level package import friendly for the GUI and scripts. __all__ = [ "__version__", "get_version", diff --git a/portscanner/gui.py b/portscanner/gui.py index ba119b7..d77fa7e 100644 --- a/portscanner/gui.py +++ b/portscanner/gui.py @@ -231,7 +231,7 @@ def create_widgets(self): font=("Segoe UI", 10, "bold"), bg="#6c6cff", fg="white", - command=lambda: self.root.clipboard_append("MIT License - see LICENSE file"), + command=self.copy_license_to_clipboard, ) copy_license_btn.pack(anchor=tk.W, pady=(0, 12)) @@ -695,6 +695,11 @@ def _queue_reset_buttons(self): def _queue_error_dialog(self, title, message): self.root.after(0, messagebox.showerror, title, message) + def copy_license_to_clipboard(self): + self.root.clipboard_clear() + self.root.clipboard_append("MIT License - see LICENSE file") + self.root.update_idletasks() + def _validate_host_field(self): val = self.normalize_host(self.host_entry.get().strip()) try: @@ -714,6 +719,7 @@ def show_help(self): "- Enter a target host or IP and press Scan.\n" "- Adjust start/end ports, thread count, and timeout.\n" "- Use python main.py --version to confirm the installed build.\n" + "- Use python run_tests.py --pattern=banner for targeted test runs.\n" "- The window title updates with the scan target and final open-port count.\n" "- Oversized scan ranges are rejected to avoid accidental heavy scans.\n" "- Use Export/Copy to save results.\n"