diff options
| author | Cody Logan <clpo13@gmail.com> | 2023-10-03 09:58:37 -0700 |
|---|---|---|
| committer | Cody Logan <clpo13@gmail.com> | 2023-10-03 09:58:37 -0700 |
| commit | e18222daecca1656390652cbd1c7f6985080241a (patch) | |
| tree | b8e201c539e1669c3cdb0598235084eb48d78c6d | |
| parent | 485df31f095a9b629a1dcc04af13956325856d8c (diff) | |
| download | wikiget-e18222daecca1656390652cbd1c7f6985080241a.tar.gz wikiget-e18222daecca1656390652cbd1c7f6985080241a.zip | |
Add short user and pass options
Swapped path short option from -p to -P and added -u for username
and -p for password
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | src/wikiget/wikiget.py | 12 | ||||
| -rw-r--r-- | wikiget.1 | 6 | ||||
| -rw-r--r-- | wikiget.1.md | 6 |
4 files changed, 16 insertions, 10 deletions
@@ -10,7 +10,7 @@ Requires Python 3.7+. Get it with `pip install --user wikiget` or `pipx install ## Usage -`wikiget [-h] [-V] [-q | -v] [-f] [-s SITE] [-p PATH] [--username USERNAME] [--password PASSWORD] [-o OUTPUT | -a] [-l LOGFILE] FILE` +`wikiget [-h] [-V] [-q | -v] [-f] [-s SITE] [-P PATH] [-u USERNAME] [-p PASSWORD] [-o OUTPUT | -a] [-l LOGFILE] FILE` The only required parameter is `FILE`, which is the file you want to download. It can either be the name of the file on the wiki, including the namespace prefix, or a link to the file description page. If `FILE` is in the form diff --git a/src/wikiget/wikiget.py b/src/wikiget/wikiget.py index 934107e..f482280 100644 --- a/src/wikiget/wikiget.py +++ b/src/wikiget/wikiget.py @@ -75,16 +75,22 @@ def main(): help="MediaWiki site to download from (default: %(default)s)", ) parser.add_argument( - "-p", + "-P", "--path", default=wikiget.DEFAULT_PATH, help="MediaWiki site path, where api.php is located (default: %(default)s)", ) parser.add_argument( - "--username", default="", help="MediaWiki site username, for private wikis" + "-u", + "--username", + default="", + help="MediaWiki site username, for private wikis" ) parser.add_argument( - "--password", default="", help="MediaWiki site password, for private wikis" + "-p", + "--password", + default="", + help="MediaWiki site password, for private wikis" ) output_options = parser.add_mutually_exclusive_group() output_options.add_argument("-o", "--output", help="write download to OUTPUT") @@ -47,16 +47,16 @@ MediaWiki site to download from. Will not have any effect if the full URL is given in the \f[I]FILE\f[R] parameter. .TP --\f[B]p\f[R], --\f[B]path\f[R] \f[I]PATH\f[R] +-\f[B]P\f[R], --\f[B]path\f[R] \f[I]PATH\f[R] Script path for the wiki, where \[lq]index.php\[rq] and \[lq]api.php\[rq] live. On Wikimedia sites, it\[cq]s \[lq]/w/\[rq], the default, but other sites may use \[lq]/\[rq] or something else entirely. .TP ---\f[B]username\f[R] \f[I]USERNAME\f[R] +-\f[B]u\f[R], --\f[B]username\f[R] \f[I]USERNAME\f[R] Username for private wikis that require a login even for read access. .TP ---\f[B]password\f[R] \f[I]PASSWORD\f[R] +-\f[B]p\f[R], --\f[B]password\f[R] \f[I]PASSWORD\f[R] Password for private wikis that require a login even for read access. .TP -\f[B]o\f[R], --\f[B]output\f[R] \f[I]OUTPUT\f[R] diff --git a/wikiget.1.md b/wikiget.1.md index 66227dc..d05aaf1 100644 --- a/wikiget.1.md +++ b/wikiget.1.md @@ -37,16 +37,16 @@ the file name or the URL of its description page. : MediaWiki site to download from. Will not have any effect if the full URL is given in the *FILE* parameter. -\-**p**, \-\-**path** *PATH* +\-**P**, \-\-**path** *PATH* : Script path for the wiki, where "index.php" and "api.php" live. On Wikimedia sites, it's "/w/", the default, but other sites may use "/" or something else entirely. -\-\-**username** *USERNAME* +\-**u**, \-\-**username** *USERNAME* : Username for private wikis that require a login even for read access. -\-\-**password** *PASSWORD* +\-**p**, \-\-**password** *PASSWORD* : Password for private wikis that require a login even for read access. |
