-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Improve AutoArgparse & rework extensions #4806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4806 +/- ##
==========================================
- Coverage 81.02% 81.01% -0.01%
==========================================
Files 365 365
Lines 89027 89060 +33
==========================================
+ Hits 72138 72156 +18
- Misses 16889 16904 +15
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the AutoArgparse decorator to support usage from scripts and adds infrastructure for bash autocompletion, while reworking the extensions loading system for Python 3.8+.
- Enhanced AutoArgparse with a
_parseonlymode for generating bash autocompletion metadata - Added bash autocompletion infrastructure with XDG-compliant directory detection and file copying utilities
- Refactored extensions loading to be more explicit and moved it to the interactive session startup
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scapy/utils.py | Enhanced AutoArgparse to support parseonly mode and improved parameter processing for bash completion |
| scapy/main.py | Added bash autocompletion infrastructure and moved extension loading to interactive session startup |
| scapy/config.py | Refactored ExtsManager to load specific extensions explicitly instead of auto-discovering all installed packages |
Comments suppressed due to low confidence (1)
scapy/utils.py:3897
- [nitpick] The parameter name
_parseonlyuses a leading underscore which typically indicates a private/internal parameter, but this could be confusing since it's part of the public function signature. Consider renaming toparseonlyorparse_only_mode.
) -> Optional[Tuple[List[str], List[str]]]:
Co-authored-by: Copilot <[email protected]>
fixes #4780