Repository navigation
feat(venv): add prefix flag to customize prompt project name - #14
Merged
Merged
Conversation
This pull request adds a new `--prefix` flag that allows users to override the project name portion of the virtual environment prompt while keeping the automatic Python version suffix. The most important changes are grouped below. **New prefix flag functionality:** * Added a new `--prefix` parameter to the `update_prompt` function in `src/main.rs` that allows overriding the project name used in the prompt, while still automatically appending the Python version suffix (e.g., `-pyX.XX`). * Updated the `scan_flags` function to parse and return the `--prefix` flag value, supporting both `--prefix value` and `--prefix=value` syntax. * Modified the prompt generation logic to use the provided prefix if available, otherwise falling back to the current directory name as before. **Documentation and help text updates:** * Updated the help text to clarify the difference between `--prefix` (overrides project name, keeps `-pyX.XX` suffix) and `--prompt` (replaces the entire auto-generated prompt). **Testing improvements:** * Added new test cases `scan_flags_prefix_space` and `scan_flags_prefix_eq` to verify correct parsing of the `--prefix` flag in both supported formats. * Updated all existing `scan_flags` test cases to handle the new fourth return value (prefix).
|
🎉 This PR is included in version 2.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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 pull request adds a new
--prefixflag that allows users to override the project name portion of the virtual environment prompt while keeping the automatic Python version suffix. The most important changes are grouped below.New prefix flag functionality:
--prefixparameter to theupdate_promptfunction insrc/main.rsthat allows overriding the project name used in the prompt, while still automatically appending the Python version suffix (e.g.,-pyX.XX).scan_flagsfunction to parse and return the--prefixflag value, supporting both--prefix valueand--prefix=valuesyntax.Documentation and help text updates:
--prefix(overrides project name, keeps-pyX.XXsuffix) and--prompt(replaces the entire auto-generated prompt).Testing improvements:
scan_flags_prefix_spaceandscan_flags_prefix_eqto verify correct parsing of the--prefixflag in both supported formats.scan_flagstest cases to handle the new fourth return value (prefix).