Command Line Syntax for the W3C Command Line Tool

W3C ComLine MANUAL

Command Line Syntax

The generic syntax is:

	w3c [ options ]  [ docaddress [ keywords ]]

Options

The order of the options is not important and options can in fact be specified on either side of any docaddress. Currently available options are:-

Getting Help

-help or -?
Load this file from directly into the browser
-v [ a | b | c | g | p | s | t | u ]
Verbose mode: Gives a running commentary on the program's attempts to read data in various ways. As the amount of verbose output is substantial, the -v option can now be followed by zero, one or more of the following flags (without space) in order to differentiate the verbose output generated:
  • a: Anchor relevant information
  • b: Bindings to local file system
  • c: Cache trace
  • g: SGML trace
  • p: Protocol module information
  • s: SGML/HTML relevant information
  • t: Thread trace
  • u: URI relevant information

The -v option without any appended options shows all trace messages. An example is

	-vpt

showing thread and protocol trace messages

-version
Prints out the version number of the software, and the version number of the WWW library, and exits.

Main Modes of execution

-
A minus sign with no trailing characters indicates that the program will accept HTML format input from the standard input. This allows www to be used as a filter from html to plain text for example. Relative links in the input are parsed as though the address of the document was that of the home page (or docaddress if specified). Implies non-interactive mode.
-cl
Counting content length of the output. This flag appends the Content-Length counter stream to the output stream so that everything is counted. This works exactly like piping the output into wc.
-h host
Establish a telnet connection to the remote host specified. This implies a "secure mode" execution where all references to the local file system are canceled.
-n
Non-interactive mode. Outputs the formatted document to the standard output, then exits. Pages are delimited with form feed (FF) characters.
-o [ file ]
Redirects output to specified file. The default value is "www-out". This mode forced non-interactive mode
-single
Singlethreaded mode. If this flag is set then the browser uses blocking, non interruptible I/O in interactive mode. Non-interactive mode always uses blocking I/O.

HTTP methods

The Line Mode Browser supports several HTTP methods. The default value is "GET". These options imply non-interactive execution.

-get
Gets a document. This is the default operation!
-head
Returns the header information (if any) but not the document
-delete
Deletes a resource (or makes it unavailable) for future references.
-put
Uploads a document from either the local file system or a remote HTTP server to a remote HTTP server (destination) using PUT method. You must indicate the destination using the -dest command line option.
-post
Uploads a document from either the local file system or a remote HTTP server to a remote HTTP server (destination) using POST method. You must indicate the destination using the -dest command line option.
-options
Ask for the available options for this URL
-trace
Ask for trace messages for this URL. You can supply the number of hop counts with the additional -maxforwards command line option

Data format conversions (non-interactive)

-from [ format ]
Only if the Line mode Browser is executed as a filter (using the "-" option), this option indicates the desired input format. The default value is "text/html".
-to [ format ]
Format is the output format for www. Default value is "www/present" but may be changed according to the HTTP-specifications. Two common output formats are "www/source" that is the source without MIME-headers and "www/mime" that is the source with the MIME-header if any. Though also "text/latex" is possible which generates a LaTeX version of the (HTML) document. This can then be compiled using latex and put out as Postscript. Default value is presenting the output to the user.
-source
Display the original source (without any MIME-headers) of a document instead of parsing it.

Directory Listings

-d 1*( t | b | r | n | s | y )
This directive can be used to modify the directory listing layout. More than one option can be specified but they might be mutually exclusive. The following options are available (withour space):
  • t: Place any readme file at the top of the list (default)
  • b: Place any readme file at the bottom of the list
  • r: Ignore any readme file
  • n: Directory listings are not allowed
  • s: Directory listings are only allowed in the directories where a file ".www_browsable" is located. The content of the file is of no importance.
  • y: Directory listings are always allowed (default)

An example is

	-dts

makes selective directory listings and places a README file at the top

Destination URL

-dest
You can specify a (relative) destination URL, for example for the operations PUT and POST using this flag. For example:
	-dest http://myserver/newfiles/foo.html

Configuration Options

-l [ file ]
Specifies a log file with a list of visited documents. The default value is "www-log"
-maxforwards <n>
Max forwards to be used with the TRACE method
-r <file>
Rule file, a.k.a. configuration file. If this is specified, a rule file may be used to map URLs, and to set up other aspects of the behavior of the browser. Many rule files may be given with successive -r options, and a default rule file name may be given using the WWW_CONFIG environment variable.
-timeout <n>
Timeout in seconds on sockets

docaddress

If present, the next argument (docaddress) is the hypertext address , of the document at which you want to start browsing. You may want to define an alias for www followed by name of your favorite index.

keywords

Any further command line arguments are taken as keywords. The first argument must refer to an index in this case. The index is searched for entries matching the keywords, and a list of matching entries is displayed.


Henrik Frystyk, libwww@w3.org,
@(#) $Id: CommandLine.html,v 1.9 1998/03/04 15:46:30 frystyk Exp $