diff --git a/lidar_pipeline/cli.py b/lidar_pipeline/cli.py index 29bfa7f..6141de0 100644 --- a/lidar_pipeline/cli.py +++ b/lidar_pipeline/cli.py @@ -216,10 +216,16 @@ Exemples: # Also supports bare name without .copc (e.g. LHD_FXX_1000_6882_PTS_LAMB93_IGN69) selected_files = [] for pattern in args.file: - matches = (list(input_dir.glob(f"{pattern}.laz")) - + list(input_dir.glob(f"{pattern}.las")) - + list(input_dir.glob(f"{pattern}.copc.laz")) - + list(input_dir.glob(f"{pattern}.copc.las"))) + # 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")) + + list(input_dir.glob(f"{pattern}.las")) + + list(input_dir.glob(f"{pattern}.copc.laz")) + + list(input_dir.glob(f"{pattern}.copc.las"))) # Remove duplicates matches = list(dict.fromkeys(matches)) if not matches: