getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.49k stars 1.81k forks source link

pelican-import option naming #2247

Closed fgallaire closed 6 years ago

fgallaire commented 6 years ago

pelican-import has a lot of options but you can only use few of them according to your source:

It's quite confusing, specially for the short options which usually are very important ones. Renaming with a prefix will be a good improvement.

ssteinerx commented 6 years ago

Or, splitting into subcommands as in pelican-import wordpress [wordpress specific options only] as is done on e.g. Git.

I think changing the command line interface on something like this that's more of an occasional-use tool is less of a big deal than it might be for a main-line type tool.

Also, with the options broken up as above, the help's a lot more helpful which eases any pain.

fgallaire commented 6 years ago

Or, splitting into subcommands as in pelican-import wordpress [wordpress specific options only] as is done on e.g. Git.

I agree, or at least a --target wordpress option instead of --wpfile --dotclear --posterous --tumblr flags

I think changing the command line interface on something like this that's more of an occasional-use tool is less of a big deal than it might be for a main-line type tool.

I agree

ssteinerx commented 6 years ago

So...next step would be to take what's there and write a proposed new command line interface.

I realize it's a big change, but I've found this helpful while thinking through CLIs and, when you've got agreement that it's right, you're pretty much done except for a bit of plumbing: http://docopt.org/

fgallaire commented 6 years ago

@ssteinerx docopt is really great for little projects, but doesn't fit with big i18ed projects as Pelican... should be?

ssteinerx commented 6 years ago

@fgallaire No opinion on that, have never i18n'd a command line util and don't know how important that might be but docopt sure is handy in situations where you need approval before coding.

avaris commented 6 years ago

argparse can do all of that, not as neatly as docopt but still. And I'd prefer not introducing new dependencies, especially for a one-off side tool.

justinmayer commented 6 years ago

Given the discussion here, what do folks think should be done about it?

justinmayer commented 6 years ago

Closing due to inactivity. If someone wants to propose something in the form of a pull request, please feel free to do so.