Fix --file argument to accept full filenames with extensions
Previously --file LHD_FXX_...copc.laz would fail because it appended extensions. Now tries exact filename match first, then falls back to adding extensions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -216,6 +216,12 @@ Exemples:
|
|||||||
# Also supports bare name without .copc (e.g. LHD_FXX_1000_6882_PTS_LAMB93_IGN69)
|
# Also supports bare name without .copc (e.g. LHD_FXX_1000_6882_PTS_LAMB93_IGN69)
|
||||||
selected_files = []
|
selected_files = []
|
||||||
for pattern in args.file:
|
for pattern in args.file:
|
||||||
|
# Try exact filename first (e.g. LHD_FXX_...copc.laz)
|
||||||
|
exact_match = input_dir / pattern
|
||||||
|
if exact_match.exists() and exact_match.is_file():
|
||||||
|
matches = [exact_match]
|
||||||
|
else:
|
||||||
|
# Try with added extensions (e.g. pattern=LHD_FXX_...IGN69)
|
||||||
matches = (list(input_dir.glob(f"{pattern}.laz"))
|
matches = (list(input_dir.glob(f"{pattern}.laz"))
|
||||||
+ list(input_dir.glob(f"{pattern}.las"))
|
+ list(input_dir.glob(f"{pattern}.las"))
|
||||||
+ list(input_dir.glob(f"{pattern}.copc.laz"))
|
+ list(input_dir.glob(f"{pattern}.copc.laz"))
|
||||||
|
|||||||
Reference in New Issue
Block a user