mirror of
				https://github.com/qurator-spk/sbb_textline_detection.git
				synced 2025-10-31 09:24:17 +01:00 
			
		
		
		
	🐛 Make required options required
When the user does not give, e.g. an input image, the program just reports a cryptic error message. Fix this and make the CLI friendlier by requiring the options using the Click API. Now the CLI gives a useful error: Error: Missing option '--image' / '-i'.
This commit is contained in:
		
							parent
							
								
									a78f40a89d
								
							
						
					
					
						commit
						8f64deefd6
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		|  | @ -2160,9 +2160,12 @@ class textline_detector: | ||||||
|          |          | ||||||
| 
 | 
 | ||||||
| @click.command() | @click.command() | ||||||
| @click.option('--image', '-i', help='image filename', type=click.Path(exists=True, dir_okay=False)) | @click.option('--image', '-i', help='image filename', | ||||||
| @click.option('--out', '-o', help='directory to write output xml data', type=click.Path(exists=True, file_okay=False)) |               type=click.Path(exists=True, dir_okay=False), required=True) | ||||||
| @click.option('--model', '-m', help='directory of models', type=click.Path(exists=True, file_okay=False)) | @click.option('--out', '-o', help='directory to write output xml data', | ||||||
|  |               type=click.Path(exists=True, file_okay=False), required=True) | ||||||
|  | @click.option('--model', '-m', help='directory of models', | ||||||
|  |               type=click.Path(exists=True, file_okay=False), required=True) | ||||||
| def main(image, out, model): | def main(image, out, model): | ||||||
|     possibles = globals()  # XXX unused? |     possibles = globals()  # XXX unused? | ||||||
|     possibles.update(locals()) |     possibles.update(locals()) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue