Universal CLI for all tools#8
Universal CLI for all tools#8stlehmann merged 22 commits intostlehmann:masterfrom jrhawley:universal-cli
Conversation
Removing individual file entries for a single unified entry with subcommands
pdfadd.py is now unncessary, since everything has been ported into the main `_cli.py` script
|
Hey James, thank you for your PR. This is one of my first open-source repositiories and as you could see I haven't touched it for a long time. However, I would like to keep it up-to-date. I like your idea of using one common entrypoint for all commands. I will have a look at your proposed changes and review your PR asap. |
stlehmann
left a comment
There was a problem hiding this comment.
Looks very good to me. Of course the README.md needs to be rewritten, too :).
| help="Merge the pages of multiple input files into one output file", | ||
| formatter_class=argparse.ArgumentDefaultsHelpFormatter, | ||
| ) | ||
| parser_merge.add_argument( |
There was a problem hiding this comment.
For all other commands the output file is defined by the -o/--output argument. This should be the same here, too.
There was a problem hiding this comment.
Makes sense. I think I left it as a required argument because you need an output file name to write to, but adding a default, as I've done in the most recent commit, should take care of this
|
I just pushed a few commits to address your earlier points, but it looks like the TravisCI checks are failing. I looked into them and it looks like there's an issue with Travis setting up Python 3.2 and 3.3 environments. v3.4 - nightly appear to be passing, though |
|
That looks great. Thanks lots for your effort here. It think these changes demand for a new mayor version. I'll merge this and take care of the rest. |
Hi @stlehmann,
I don't know if you're still actively maintaining this repo or not, but I recently stumbled upon it and think it's great and it has all the nice functionality I've wanted in a command line tool for manipulating PDFs.
What I wanted to have was a universal CLI command to call, with each tools as a sub-command, instead of having
pdfmerge.py,pdfsplit.py, etc in myPATHand calling those commands.So in this PR, I've refactored the code to have a single entry point (
pdftools), with all the appropriate functions as sub-commands (e.g.pdftools merge).I've also formatted some of the arguments to have consistent naming and help statements to try and help with clarity.
If you don't want to merge this PR that's cool, I don't mind. I figured if I refactored this code to make the tool more accessible for myself, then you/others might be interested in it too.