66from ..repository import LocalDriverRepository , V1Alpha1DriverPackage
77
88
9- def print_package_info (package : V1Alpha1DriverPackage ):
9+ def print_package_info (package : V1Alpha1DriverPackage , verbose : bool ):
1010 """Print basic package information."""
11+ dist = package .get_distribution ()
1112 click .echo ("Name: " + package .name )
1213 click .echo ("Version: " + package .version )
1314 click .echo ("Summary: " + (package .summary if package .summary else "" ))
14- click .echo ("Categories: " + ", " .join (package .categories ))
15+ click .echo ("Home-page: " + dist .metadata .get ("Home-Page" , "" ))
16+ click .echo ("Author: " + dist .metadata .get ("Author" , "" ))
17+ click .echo ("Author-email: " + dist .metadata .get ("Author-email" , "" ))
1518 click .echo ("License: " + (package .license if package .license else "" ))
19+ click .echo ("Location: " + dist .metadata .get ("Location" , "" ))
20+ click .echo ("Requires: " + dist .metadata .get ("Requires" , "" ))
21+ click .echo ("Metadata-Version: " + dist .metadata .get ("Metadata-Version" , "" ))
22+ # Only show installer and classifiers for verbose output
23+ if verbose :
24+ click .echo ("Installer: " + dist .metadata .get ("Installer" , "" ))
25+ click .echo ("Classifiers: " + dist .metadata .get ("Classifiers" , "" ))
26+ click .echo ("Categories: " + ", " .join (package .categories ))
1627
1728
1829def print_drivers (package : V1Alpha1DriverPackage , inspect : bool ):
1930 """Print drivers information."""
2031 click .echo ("Drivers:" )
2132 for driver in package .drivers .items :
22- click .echo (f" { driver .name } :" )
23- click .echo (f" Module: { driver .module } " )
24- click .echo (f" Class: { driver .class_name } " )
25- click .echo (f" Type: { driver .type } " )
33+ click .echo (f" { driver .name } :" )
34+ click .echo (f" Module: { driver .module } " )
35+ click .echo (f" Class: { driver .class_name } " )
36+ click .echo (f" Type: { driver .type } " )
2637
2738 client_type_out = driver .client_type if driver .client_type else "(not available)"
2839 if not inspect :
2940 client_type_out = "(run this command with --inspect to see the client type)"
30- click .echo (f" Client: { client_type_out } " )
41+ click .echo (f" Client: { client_type_out } " )
3142
3243 summary_out = driver .summary if driver .summary else "(not available)"
3344 if not inspect :
3445 summary_out = "(run this command with --inspect to see the summary)"
35- click .echo (f" Summary: { summary_out } " )
46+ click .echo (f" Summary: { summary_out } " )
3647
3748
3849def print_driver_clients (package : V1Alpha1DriverPackage , inspect : bool ):
3950 """Print driver clients information."""
40- click .echo ("Driver Clients:" )
51+ click .echo ("Driver- Clients:" )
4152 for driver_client in package .driver_clients .items :
42- click .echo (f" { driver_client .name } :" )
43- click .echo (f" Module: { driver_client .module } " )
44- click .echo (f" Class: { driver_client .class_name } " )
45- click .echo (f" Type: { driver_client .type } " )
53+ click .echo (f" { driver_client .name } :" )
54+ click .echo (f" Module: { driver_client .module } " )
55+ click .echo (f" Class: { driver_client .class_name } " )
56+ click .echo (f" Type: { driver_client .type } " )
4657
4758 summary_out = driver_client .summary if driver_client .summary else "(not available)"
4859 if not inspect :
4960 summary_out = "(run this command with --inspect to see the summary)"
50- click .echo (f" Summary: { summary_out } " )
61+ click .echo (f" Summary: { summary_out } " )
5162 cli_out = "Yes" if driver_client .cli else "No"
5263 if not inspect :
5364 cli_out = "(run this command with --inspect to check if a CLI is available)"
54- click .echo (f" Has CLI: { cli_out } " )
65+ click .echo (f" Has- CLI: { cli_out } " )
5566
5667
5768def print_adapters (package : V1Alpha1DriverPackage , inspect : bool ):
5869 """Print adapters information."""
5970 click .echo ("Adapters:" )
6071 for adapter in package .adapters .items :
61- click .echo (f" { adapter .name } :" )
62- click .echo (f" Module: { adapter .module } " )
63- click .echo (f" Function: { adapter .function_name } " )
64- click .echo (f" Type: { adapter .type } " )
72+ click .echo (f" { adapter .name } :" )
73+ click .echo (f" Module: { adapter .module } " )
74+ click .echo (f" Function: { adapter .function_name } " )
75+ click .echo (f" Type: { adapter .type } " )
6576 summary_out = adapter .summary if adapter .summary else "(not available)"
6677 if not inspect :
6778 summary_out = "(run this command with --inspect to see the summary)"
68- click .echo (f" Summary: { summary_out } " )
79+ click .echo (f" Summary: { summary_out } " )
6980
7081
7182def print_package_details (
72- package : V1Alpha1DriverPackage , drivers : bool , driver_clients : bool , adapters : bool , inspect : bool
83+ package : V1Alpha1DriverPackage , drivers : bool , driver_clients : bool , adapters : bool , inspect : bool , verbose : bool
7384):
7485 """Print package details based on the specified flags."""
7586 flag_sum = sum ([drivers , driver_clients , adapters ])
7687
7788 if flag_sum == 0 :
78- print_package_info (package )
89+ print_package_info (package , verbose )
7990
8091 if flag_sum == 0 or drivers :
8192 print_drivers (package , inspect )
@@ -94,8 +105,11 @@ def print_package_details(
94105@opt_adapters
95106@opt_inspect
96107@opt_output_all
108+ @click .option ("--verbose" , "-v" , is_flag = True , help = "Show verbose output." )
97109@handle_exceptions
98- def show (package : str , drivers : bool , driver_clients : bool , adapters : bool , output : OutputType , inspect : bool ):
110+ def show (
111+ package : str , drivers : bool , driver_clients : bool , adapters : bool , output : OutputType , inspect : bool , verbose : bool
112+ ):
99113 """
100114 Show a Jumpstarter plugin package details.
101115 """
@@ -126,4 +140,4 @@ def show(package: str, drivers: bool, driver_clients: bool, adapters: bool, outp
126140 else :
127141 click .echo (local_package .dump_yaml ())
128142 case _:
129- print_package_details (local_package , drivers , driver_clients , adapters , inspect )
143+ print_package_details (local_package , drivers , driver_clients , adapters , inspect , verbose )
0 commit comments