@@ -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 ,
@@ -103,7 +104,7 @@ def cat(
103
104
pdfly .cat .main (filename , fn_pgrgs , output , verbose )
104
105
105
106
106
- @entry_point .command (name = "meta" ) # type: ignore[misc]
107
+ @entry_point .command (name = "meta" , help = pdfly . metadata . __doc__ ) # type: ignore[misc]
107
108
def metadata (
108
109
pdf : Annotated [
109
110
Path ,
@@ -127,7 +128,7 @@ def metadata(
127
128
pdfly .metadata .main (pdf , output )
128
129
129
130
130
- @entry_point .command (name = "pagemeta" ) # type: ignore[misc]
131
+ @entry_point .command (name = "pagemeta" , help = pdfly . pagemeta . __doc__ ) # type: ignore[misc]
131
132
def pagemeta (
132
133
pdf : Annotated [
133
134
Path ,
@@ -178,7 +179,7 @@ def extract_text(
178
179
print (page .extract_text ())
179
180
180
181
181
- @entry_point .command (name = "compress" ) # type: ignore[misc]
182
+ @entry_point .command (name = "compress" , help = pdfly . compress . __doc__ ) # type: ignore[misc]
182
183
def compress (
183
184
pdf : Annotated [
184
185
Path ,
@@ -202,7 +203,7 @@ def compress(
202
203
pdfly .compress .main (pdf , output )
203
204
204
205
205
- @entry_point .command (name = "x2pdf" ) # type: ignore[misc]
206
+ @entry_point .command (name = "x2pdf" , help = pdfly . x2pdf . __doc__ ) # type: ignore[misc]
206
207
def x2pdf (
207
208
x : List [Path ],
208
209
output : Annotated [
@@ -216,12 +217,3 @@ def x2pdf(
216
217
],
217
218
) -> int :
218
219
return pdfly .x2pdf .main (x , output )
219
-
220
-
221
- up2 .__doc__ = pdfly .up2 .__doc__
222
- extract_images .__doc__ = pdfly .extract_images .__doc__
223
- cat .__doc__ = pdfly .cat .__doc__
224
- metadata .__doc__ = pdfly .metadata .__doc__
225
- pagemeta .__doc__ = pdfly .pagemeta .__doc__
226
- compress .__doc__ = pdfly .compress .__doc__
227
- x2pdf .__doc__ = pdfly .x2pdf .__doc__
0 commit comments