Re: [PATCH 3/4] remote-mediawiki: show known namespace choices on failure
- From
Antoine Beaupré <anarcat@debian.org>
- Date
- Oct 29, 2017, 18:31 UTC
- Message-ID
- <877evd9561.fsf@curie.anarc.at>
- In-Reply-To
- <CAPig+cSkwD35wK7Z_qZZusKWWBC5CU6AnbF9g_g907uqpeYQsw@mail.gmail.com>
On 2017-10-29 13:34:31, Eric Sunshine wrote:
> On Sun, Oct 29, 2017 at 12:08 PM, Antoine Beaupré <anarcat@debian.org> wrote: >> if we fail to find a requested namespace, we should tell the user > > s/if/If/
fixed.
Show 5 quoted lines
>> which ones we know about, since we already do. this allows users to > > s/this/This/ > > Not sure what ", since we already do" means here.
we already have fetched the mapping, fixed.
>> feetch all namespaces by specifying a dummy namespace, failing, then > > s/feetch/fetch/
fixed.
Show 19 quoted lines
>> copying the list of namespaces in the config.
>>
>> eventually, we should have a flag that allows fetching all namespaces
>> automatically.
>>
>> Reviewed-by: Antoine Beaupré <anarcat@debian.org>
>> Signed-off-by: Antoine Beaupré <anarcat@debian.org>
>> ---
>> diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
>> @@ -1334,7 +1334,9 @@ sub get_mw_namespace_id {
>> my $id;
>>
>> if (!defined $ns) {
>> - print {*STDERR} "No such namespace ${name} on MediaWiki.\n";
>> + my @namespaces = sort keys %namespace_id;
>> + for (@namespaces) { s/ /_/g; }
>> + print {*STDERR} "No such namespace ${name} on MediaWiki, known namespaces: @namespaces.\n";
>
> Probably want to drop the terminating "." in the error message.meh... i just respected what was already there, but it's true it can be error-prone when copy-pasting, so removed.
a.
--
A ballot is like a bullet. You don't throw your ballots until you see
a target, and if that target is not within your reach, keep your
ballot in your pocket.
- Malcom X