Skip to content

Commit 4349375

Browse files
authored
Merge branch 'main' into main
2 parents 6450417 + b9b77ec commit 4349375

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

pdfly/cli.py

+8-16
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def version_callback(value: bool) -> None:
3333
help=(
3434
"pdfly is a pure-python cli application for manipulating PDF files."
3535
),
36+
rich_markup_mode="rich", # Allows to pretty-print commands documentation
3637
)
3738

3839

@@ -44,7 +45,7 @@ def common(
4445
pass
4546

4647

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]
4849
def extract_images(
4950
pdf: Annotated[
5051
Path,
@@ -61,7 +62,7 @@ def extract_images(
6162
pdfly.extract_images.main(pdf)
6263

6364

64-
@entry_point.command(name="2-up") # type: ignore[misc]
65+
@entry_point.command(name="2-up", help=pdfly.up2.__doc__) # type: ignore[misc]
6566
def up2(
6667
pdf: Annotated[
6768
Path,
@@ -79,7 +80,7 @@ def up2(
7980
pdfly.up2.main(pdf, out)
8081

8182

82-
@entry_point.command(name="cat") # type: ignore[misc]
83+
@entry_point.command(name="cat", help=pdfly.cat.__doc__) # type: ignore[misc]
8384
def cat(
8485
filename: Annotated[
8586
Path,
@@ -129,7 +130,7 @@ def rm(
129130
)
130131

131132

132-
@entry_point.command(name="meta") # type: ignore[misc]
133+
@entry_point.command(name="meta", help=pdfly.metadata.__doc__) # type: ignore[misc]
133134
def metadata(
134135
pdf: Annotated[
135136
Path,
@@ -153,7 +154,7 @@ def metadata(
153154
pdfly.metadata.main(pdf, output)
154155

155156

156-
@entry_point.command(name="pagemeta") # type: ignore[misc]
157+
@entry_point.command(name="pagemeta", help=pdfly.pagemeta.__doc__) # type: ignore[misc]
157158
def pagemeta(
158159
pdf: Annotated[
159160
Path,
@@ -204,7 +205,7 @@ def extract_text(
204205
print(page.extract_text())
205206

206207

207-
@entry_point.command(name="compress") # type: ignore[misc]
208+
@entry_point.command(name="compress", help=pdfly.compress.__doc__) # type: ignore[misc]
208209
def compress(
209210
pdf: Annotated[
210211
Path,
@@ -228,7 +229,7 @@ def compress(
228229
pdfly.compress.main(pdf, output)
229230

230231

231-
@entry_point.command(name="x2pdf") # type: ignore[misc]
232+
@entry_point.command(name="x2pdf", help=pdfly.x2pdf.__doc__) # type: ignore[misc]
232233
def x2pdf(
233234
x: List[Path],
234235
output: Annotated[
@@ -242,12 +243,3 @@ def x2pdf(
242243
],
243244
) -> int:
244245
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

Comments
 (0)