Page MenuHomePhabricator

importTextFile.php: add stdin instructions
Closed, InvalidPublic

Description

In importTextFile.php

		echo( "does not exist.\n" );

Say what doesn't exist. FILE:? TITLE:?
Add the word 'file "..........."'

$ php importTextFile.php --title Bla -
Import Text File

Using ...does not exist.

In importTextFile.php say how one can use stdin.

Not clear if importTextFile.php returns an error to the shell
upon failure.

P.S. Also one day have a look at importTextFile.php with emacs'
show-trailing-whitespace turned on.

And sure wish Mom would buy me a terminal as wide as the brand the
editor uses. The 156 character long line needs column 163 to display
it. All that wrapping makes one dizzy.

Idea: in function showHelp(), instead of many echos, use one
echo<<<EOF
Import the contents of a text file into a wiki page.
USAGE: php importTextFile.php [--help|--title <title>|--user <user>|--comment <comment>|--nooverwrite] <filename>

          --help: Show this help information
--title <title> : Title for the new page; if not supplied, the filename is used as a base for the title
  --user <user> : User to be associated with the edit; if not supplied, a default is used

--comment <comment> : Edit summary to be associated with the edit; underscores are transformed into spaces;

                if not supplied, a default is used
--nooverwrite : Don't overwrite existing page content
   <filename> : Path to the file containing the wikitext to import

EOF
(and again, say how to use /dev/stdin etc. which didn't seem to work.)


Version: 1.9.x
Severity: minor
OS: Linux
Platform: PC

Details

Reference
bz8973

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:32 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz8973.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

I don't believe it's possible to feed text in through standard input with that
script; use the edit.php script for that. This is targetted at mass file imports.

Can you possibly make the effort to file bugs properly? As in, using one bug per
issue; the right products and components, the right summaries, etc.