feat(cli): Add --filename-template and --max-length options #763
feat(cli): Add --filename-template and --max-length options #763AdamQuadmon wants to merge 1 commit intoadbar:masterfrom
Conversation
Introduces two new CLI arguments to allow fine-grained control over how output file paths are generated:
--filename-template: Specify a template string using variables like {domain}, {hash}, {ext} to define a custom directory structure and file naming scheme
--max-length: Set a maximum character limit for generated file paths, intelligently truncating if needed while preserving essential components
Includes documentation updates covering the new options, examples, and troubleshooting.
Closes adbar#754
|
That will be great. I am looking forward for this feature to make it to this incredible tool. |
| f"Generated path length {len(output_dir)} exceeds limit of 50: {output_dir}", | ||
| ) | ||
| self.assertTrue( | ||
| output_dir.startswith("example.com"), |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
| f"Generated path length {len(output_dir)} exceeds limit of 40: {output_dir}", | ||
| ) | ||
| self.assertTrue( | ||
| output_dir.startswith("example.com"), |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
|
|
||
| # Basic assertions | ||
| self.assertTrue( | ||
| output_dir.startswith("example.com"), f"Domain not preserved: {output_dir}" |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
| # Verify long path handling | ||
| self.assertLessEqual(len(output_dir2), 50, "Long path not properly truncated") | ||
| self.assertTrue( | ||
| output_dir2.startswith("example.com"), "Domain lost in long path truncation" |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #763 +/- ##
==========================================
- Coverage 99.26% 99.03% -0.24%
==========================================
Files 21 22 +1
Lines 3559 3728 +169
==========================================
+ Hits 3533 3692 +159
- Misses 26 36 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@AdamQuadmon Thanks for the substantial PR, it's great that you included tests and documentation. Could you please make sure the tests pass for older Python versions? I don't think the code security warning are important. |
|
Please also improve test coverage. |
|
@AdamQuadmon Are you still working on the PR? |
Introduces two new CLI arguments to allow fine-grained control over how output file paths are generated:
--filename-template: Specify a template string using variables like {domain}, {hash}, {ext} to define a custom directory structure and file naming scheme
--max-length: Set a maximum character limit for generated file paths, intelligently truncating if needed while preserving essential components
Includes documentation and tests.
Closes #754