Differences From:
File
src/main.c
part of check-in
[c9fdb846fb]
- Add the "help" command and the "clean" command. More work is needed
on the text for various help messages.
by
drh on
2007-08-18 02:45:47.
[view]
To:
File
src/main.c
part of check-in
[6607844a01]
- Added options to the "timeline" CLI command. Additional help comments.
by
drh on
2007-08-18 11:42:24.
[view]
@@ -383,9 +383,9 @@
void help_cmd(void){
int rc, idx;
const char *z;
if( g.argc!=3 ){
- printf("Usage: %s help <command>.\nAvailable commands:\n", g.argv[0]);
+ printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
cmd_cmd_list();
return;
}
rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
@@ -520,22 +520,22 @@
/*
** COMMAND: cgi
**
-** The single argument is the name of a file that is the CGI script
-** that is being run. This file should look something like this:
+** Usage: %fossil ?cgi? SCRIPT
+**
+** The SCRIPT argument is the name of a file that is the CGI script
+** that is being run. The command name, "cgi", may be omitted if
+** the GATEWAY_INTERFACE environment variable is set to "CGI" (which
+** should always be the case for CGI scripts run by a webserver.) The
+** SCRIPT file should look something like this:
**
** #!/usr/bin/fossil
** repository: /home/somebody/project.db
**
-** We are interested in the line that defines the name of the repository.
-** Read the file, find the repository line. Then open the respository
-** database.
-**
-** Also do the usual CGI initialization stuff in the cgi.c module.
-**
-** After all of the above setup, call process_one_web_page() to do the
-** web page processing and return the result.
+** The second line defines the name of the repository. After locating
+** the repository, fossil will generate a webpage on stdout based on
+** the values of standard CGI environment variables.
*/
void cmd_cgi(void){
const char *zFile;
Blob config, line, key, value;
@@ -575,13 +575,14 @@
/*
** COMMAND: http
**
-** Handle a single HTTP request appearing on standard input. This
-** method is used to launch an HTTP request handler from INETD, for
-** example.
+** Usage: %fossil http REPOSITORY
**
-** The argument is the name of the repository.
+** Handle a single HTTP request appearing on stdin. The resulting webpage
+** is delivered on stdout. This method is used to launch an HTTP request
+** handler from inetd, for example. The argument is the name of the
+** repository.
*/
void cmd_http(void){
if( g.argc!=2 && g.argc!=3 ){
cgi_panic("no repository specified");
@@ -598,13 +599,15 @@
/*
** COMMAND: server
**
-** Open a socket and begin listening for incoming HTTP requests.
-** As each connection is received, fork a new child process to handle
-** the request.
+** Usage: %fossil server ?-P|--port TCPPORT? ?REPOSITORY?
**
-** The argument is the name of the repository.
+** Open a socket and begin listening and responding to HTTP requests on
+** TCP port 8080, or on any other TCP port defined by the -P or
+** --port option. The optional argument is the name of the repository.
+** The repository argument may be omitted if the working directory is
+** within an open checkout.
*/
void cmd_webserver(void){
int iPort;
const char *zPort;