Page MenuHomePhabricator

--help option should works too
Closed, DeclinedPublic

Description

When I use -help I get list of commands which can be executed with script.
When I use --help I get error (example):

C:\Users\zoran\Desktop\development\pywikibot-core>python pwb.py add_text.py --help
ERROR: Unable to execute script because no generator was defined.
Use -help for further information.

--help should be made as redirect to -help because of Linux users which use --help for commands.

Note: This is not only for add_text.py. This is for core of Pywikibot.

Event Timeline

Xqt triaged this task as Lowest priority.Dec 16 2018, 4:18 AM
Xqt subscribed.

I guess there is an old patch that could provide it.

Pywikibot was warned multiple times about this issue. Single hyphen ("-") should be used only for shortcuts (one-two letters), double hyphen ("--") should be used for full length parameters and equal sign ("=") to match values with parameters. Therefore Pywikibot does not follow POSIX standard (standard for command line projects). Because of that multiple issues arised (e.g. T196880 would not exist if we would follow POSIX standard).

But we can not fully switch parameter format, because we would break many running bots all over the world. We can only add alternatives.

I would recommend not to add the alternative for help parameter only as it is non-systematic. We should add this option for all globals or for none of them.

Pywikibot was warned multiple times about this issue

Can you explain?

Pywikibot was warned multiple times about this issue

Can you explain?

Me: Sphinx devs, please improve your parameter parser for doc
Sphinx devs: Pywikibot doesn't follow POSIX standard and you want something from us? HAHA

Me: Docopt devs, please add some other parameter style options
Docopt devs: Pywikibot should follow POSIX standard, marking as lowest priority and declining after a month of no dev activity in this area. Sorry guys

Users get used to it quickly, only other devs are somehow not understanding, why we are not using what everyone uses.

Pywikibot was warned multiple times about this issue.

Pywikibot 4.0 needed to deprecate all non-standard behavior :) <rant>and then there's dd from GNU coreutils that's not really conformant either</rant>

Why didn't we use argparse when we rewrote trunk/compat to rewrite/core...

Pywikibot 4.0 would need multiple huge changes. E.g. rewrite/deprecate scripts like category.py or template.py. Those basic scripts should be moved to some sort of module system or something more standard and unified :D

BTW docopt would be for Pywikibot maybe more apropriate than argparse, but two years ago it was not possible.

There should be a unified behavior of commands.