feat: add --version flag to the CLI#303
Open
ETM-Code wants to merge 1 commit into
Open
Conversation
- Add a `--version` flag to the main CLI group using click's `version_option` - Prints `Scrapling, version <version>` and exits, sourcing the version from `scrapling.__version__` - Add a CLI test asserting the flag's output Closes D4Vinci#299
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.
What
Adds a
--versionflag to thescraplingCLI, as requested in #299.How
maingroup with click'sversion_option, sourcing the version fromscrapling.__version__and usingprog_name="Scrapling"so the output matches the format requested in the issue.test_version_flagtest totests/cli/test_cli.pyasserting exit code0and the exact output string.Notes
version_optionships with click, which is already a CLI requirement).devbranch per CONTRIBUTING.md.ruff check,ruff format --check(cli.py),vermin, andbanditpass on the changed code; the fulltests/cli/test_cli.pysuite passes locally.Closes #299