4747 QrRenderEngine ,
4848 RenderContext ,
4949 RenderEngine ,
50- TestPatternRenderEngine ,
50+ SamplePatternRenderEngine ,
5151 TextRenderEngine ,
5252)
5353
@@ -142,12 +142,12 @@ def default(
142142 FontStyle , typer .Option (help = "Set fonts style" , rich_help_panel = "Design" )
143143 ] = DefaultFontStyle ,
144144 frame_width_px : Annotated [
145- Optional [ int ] ,
145+ int ,
146146 typer .Option (
147147 help = "Draw frame of given width [px] around text" ,
148148 rich_help_panel = "Design" ,
149149 ),
150- ] = None ,
150+ ] = 0 ,
151151 align : Annotated [
152152 Direction , typer .Option (help = "Align multiline text" , rich_help_panel = "Design" )
153153 ] = Direction .LEFT ,
@@ -159,7 +159,7 @@ def default(
159159 rich_help_panel = "Design" ,
160160 ),
161161 ] = Direction .LEFT ,
162- test_pattern : Annotated [
162+ sample_pattern : Annotated [
163163 Optional [int ],
164164 typer .Option (help = "Prints test pattern of a desired dot width" ),
165165 ] = None ,
@@ -205,13 +205,12 @@ def default(
205205 typer .Option ("--barcode" , help = "Barcode" , rich_help_panel = "Elements" ),
206206 ] = None ,
207207 barcode_type : Annotated [
208- Optional [ BarcodeType ] ,
208+ BarcodeType ,
209209 typer .Option (
210210 help = "Barcode type" ,
211- show_default = DEFAULT_BARCODE_TYPE .value ,
212211 rich_help_panel = "Elements" ,
213212 ),
214- ] = None ,
213+ ] = DEFAULT_BARCODE_TYPE ,
215214 barcode_with_text_content : Annotated [
216215 Optional [str ],
217216 typer .Option (
@@ -364,6 +363,13 @@ def default(
364363 hidden = True ,
365364 ),
366365 ] = None ,
366+ test_pattern : Annotated [
367+ Optional [int ],
368+ typer .Option (
369+ help = "DEPRECATED" ,
370+ hidden = True ,
371+ ),
372+ ] = None ,
367373) -> None :
368374 if ctx .invoked_subcommand is not None :
369375 return
@@ -420,6 +426,10 @@ def default(
420426 raise typer .BadParameter ("The -l flag is deprecated. Use --min-length instead." )
421427 if old_justify is not None :
422428 raise typer .BadParameter ("The -j flag is deprecated. Use --justify instead." )
429+ if test_pattern is not None :
430+ raise typer .BadParameter (
431+ "The --test-pattern flag is deprecated. Use --sample-pattern instead."
432+ )
423433
424434 # read config file
425435 try :
@@ -429,9 +439,6 @@ def default(
429439 msg = f"{ e } . Valid fonts are: { ', ' .join (valid_font_names )} "
430440 raise typer .BadParameter (msg ) from None
431441
432- if barcode_type and not (barcode_content or barcode_with_text_content ):
433- raise typer .BadParameter ("Cannot specify barcode type without a barcode value" )
434-
435442 if barcode_with_text_content and barcode_content :
436443 raise typer .BadParameter (
437444 "Cannot specify both barcode with text and regular barcode"
@@ -454,8 +461,8 @@ def default(
454461
455462 render_engines : list [RenderEngine ] = []
456463
457- if test_pattern :
458- render_engines .append (TestPatternRenderEngine ( test_pattern ))
464+ if sample_pattern :
465+ render_engines .append (SamplePatternRenderEngine ( sample_pattern ))
459466
460467 if qr_content :
461468 render_engines .append (QrRenderEngine (qr_content ))
@@ -511,6 +518,8 @@ def default(
511518 device = None
512519
513520 dymo_labeler = DymoLabeler (tape_size_mm = tape_size_mm , device = device )
521+ if not render_engines :
522+ raise typer .BadParameter ("No elements to print" )
514523 render_engine = HorizontallyCombinedRenderEngine (render_engines )
515524 render_context = RenderContext (
516525 background_color = "white" ,
0 commit comments