@@ -33,6 +33,7 @@ def version_callback(value: bool) -> None:
33
33
help = (
34
34
"pdfly is a pure-python cli application for manipulating PDF files."
35
35
),
36
+ rich_markup_mode = "rich" , # Allows to pretty-print commands documentation
36
37
)
37
38
38
39
@@ -44,7 +45,7 @@ def common(
44
45
pass
45
46
46
47
47
- @entry_point .command (name = "extract-images" ) # type: ignore[misc]
48
+ @entry_point .command (name = "extract-images" , help = pdfly . extract_images . __doc__ ) # type: ignore[misc]
48
49
def extract_images (
49
50
pdf : Annotated [
50
51
Path ,
@@ -61,7 +62,7 @@ def extract_images(
61
62
pdfly .extract_images .main (pdf )
62
63
63
64
64
- @entry_point .command (name = "2-up" ) # type: ignore[misc]
65
+ @entry_point .command (name = "2-up" , help = pdfly . up2 . __doc__ ) # type: ignore[misc]
65
66
def up2 (
66
67
pdf : Annotated [
67
68
Path ,
@@ -79,7 +80,7 @@ def up2(
79
80
pdfly .up2 .main (pdf , out )
80
81
81
82
82
- @entry_point .command (name = "cat" ) # type: ignore[misc]
83
+ @entry_point .command (name = "cat" , help = pdfly . cat . __doc__ ) # type: ignore[misc]
83
84
def cat (
84
85
filename : Annotated [
85
86
Path ,
@@ -129,7 +130,7 @@ def rm(
129
130
)
130
131
131
132
132
- @entry_point .command (name = "meta" ) # type: ignore[misc]
133
+ @entry_point .command (name = "meta" , help = pdfly . metadata . __doc__ ) # type: ignore[misc]
133
134
def metadata (
134
135
pdf : Annotated [
135
136
Path ,
@@ -153,7 +154,7 @@ def metadata(
153
154
pdfly .metadata .main (pdf , output )
154
155
155
156
156
- @entry_point .command (name = "pagemeta" ) # type: ignore[misc]
157
+ @entry_point .command (name = "pagemeta" , help = pdfly . pagemeta . __doc__ ) # type: ignore[misc]
157
158
def pagemeta (
158
159
pdf : Annotated [
159
160
Path ,
@@ -204,7 +205,7 @@ def extract_text(
204
205
print (page .extract_text ())
205
206
206
207
207
- @entry_point .command (name = "compress" ) # type: ignore[misc]
208
+ @entry_point .command (name = "compress" , help = pdfly . compress . __doc__ ) # type: ignore[misc]
208
209
def compress (
209
210
pdf : Annotated [
210
211
Path ,
@@ -228,7 +229,7 @@ def compress(
228
229
pdfly .compress .main (pdf , output )
229
230
230
231
231
- @entry_point .command (name = "x2pdf" ) # type: ignore[misc]
232
+ @entry_point .command (name = "x2pdf" , help = pdfly . x2pdf . __doc__ ) # type: ignore[misc]
232
233
def x2pdf (
233
234
x : List [Path ],
234
235
output : Annotated [
@@ -242,12 +243,3 @@ def x2pdf(
242
243
],
243
244
) -> int :
244
245
return pdfly .x2pdf .main (x , output )
245
-
246
-
247
- up2 .__doc__ = pdfly .up2 .__doc__
248
- extract_images .__doc__ = pdfly .extract_images .__doc__
249
- cat .__doc__ = pdfly .cat .__doc__
250
- metadata .__doc__ = pdfly .metadata .__doc__
251
- pagemeta .__doc__ = pdfly .pagemeta .__doc__
252
- compress .__doc__ = pdfly .compress .__doc__
253
- x2pdf .__doc__ = pdfly .x2pdf .__doc__
0 commit comments