metaist / pdfmerge

Command-line utility for merging, splicing, and rotating PDF documents.
http://metaist.github.io/pdfmerge/
Other
121 stars 24 forks source link

pdfmerge -h #21

Closed mbeffa closed 1 year ago

mbeffa commented 6 years ago

I have this outdated concept that any program should respond to the -h command with a full list of features. pdfmerge claims to be able to rotate, but there is zero mention of rotate in the -h output.

pdfmerge -h

usage: pdfmerge [-h] [--version] [-o FILE] [-p PASSWORD] PATH [PATH ...]

Then I see the example on github,

$ pdfmerge -o out.pdf file1.pdf file2.pdf[3,3] file2.pdf[1V,2..-1] "other*.pdf[<]" "/path/pdf[1..4>,5]"

Now this is really, really smart. [3,3] is a well-known code for what? Am I the only person in the world who does not understand? [1V,2..-1] ?!?!??? [1..4>,5] ?@!

Thanks a lot.

metaist commented 6 years ago

Hi @mbeffa.

Fair point and I will update this or accept a PR that does this well. In general, it feels like dumping lots of text into -h is less preferable to having a man page with lots of explanation, but the benefit of keeping everything together rather than having to look stuff up on GitHub wins.

To be fair, the rest of the README does go on to explain what all those modifiers do with examples. To answer your specific questions:

Let me know if this still doesn't make sense.

mbeffa commented 6 years ago

Thank you for your reply, but I feel such an idiot. Obviously everybody knows that "[3,3] means the output should include page 3 of file2.pdf twice.", right? I do not know how I could miss such a simple convention. Same with the others.

I checked the man page, but it was not installed. Maybe you could consider -h for reduced help and --help for extended.

Luckily the unstall proceeded smoothly.

On Tue, Jan 9, 2018 at 6:18 PM, metaist notifications@github.com wrote:

Hi @mbeffa https://github.com/mbeffa.

Fair point and I will update this or accept a PR that does this well. In general, it feels like dumping lots of text into -h is less preferable to having a man page with lots of explanation, but the benefit of keeping everything together rather than having to look stuff up on GitHub wins.

To be fair, the rest of the README does go on to explain what all those modifiers do with examples. To answer your specific questions:

Let me know if this still doesn't make sense.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/metaist/pdfmerge/issues/21#issuecomment-356479220, or mute the thread https://github.com/notifications/unsubscribe-auth/AgqXiZqPRugFp-2VGMAvyDDITJvwVzhGks5tJB3mgaJpZM4RYdYG .

metaist commented 6 years ago

I'm not trying to put you down or make you feel stupid. Good idea with --help, I could just dump the relevant parts of the README.

Is there a convention with which you are more familiar? I wanted something array-like so that I could specify parts of a file, but also wanted it to be 1-indexed so that I could think of page numbers.

What is it that you're trying to do? Sounds like you're looking for a way to rotate a page some amount other than 90 degrees. That might an interesting feature to consider down the road.

In the meantime, you could use ImageMagick like so:

$ convert original.pdf -rotate 37 output.pdf
metaist commented 1 year ago

I've gone ahead an added the relevant bits to --help using a docopt like docstring.