Refactor cli.py – Improve consistency and handle missing dependencies issue #12#65
Open
Diksha78-bot wants to merge 1 commit intoAdmGenSameer:mainfrom
Open
Refactor cli.py – Improve consistency and handle missing dependencies issue #12#65Diksha78-bot wants to merge 1 commit intoAdmGenSameer:mainfrom
Diksha78-bot wants to merge 1 commit intoAdmGenSameer:mainfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the cli.py file to improve overall consistency, error handling, and user experience. Key updates include:
Changes made:
Added detailed handling for missing distro dependency.
Improved Linux distribution detection with better warnings for unsupported or unknown distros.
Centralized search error handling for all package sources (AUR, Pacman, Flatpak, Snap, APT, DNF).
Enhanced package scoring algorithm for better top-match selection.
Added GitHub fallback when no packages are found.
Updated CLI output messages with clear instructions and panels for warnings/errors.
Testing performed:
Verified that running python cli.py works without crashing.
Tested on Windows (fallback to GitHub search works as expected).
Verified that missing dependencies (like distro) show proper error message and installation instructions.
Top matching packages display correctly with interactive installation flow (if supported).
Note for reviewers:
On Windows, system-specific package managers like Pacman/Flatpak are not available, so GitHub fallback is expected behavior.
All critical changes are within cli.py.