Fossil SCM

Add the "version" command to print out the source-code version number for the fossil executable.

drh 2008-10-18 20:29 trunk
Commit a1f727be9d0ffa2c3f373ce66154a41d17dec767
1 file changed +13 -1
+13 -1
--- src/main.c
+++ src/main.c
@@ -424,10 +424,22 @@
424424
aCmd[nCmd++] = aCommand[i].zName;
425425
}
426426
multi_column_list(aCmd, nCmd);
427427
}
428428
429
+
430
+/*
431
+** COMMAND: version
432
+**
433
+** Usage: %fossil version
434
+**
435
+** Print the source code version number for the fossil executable.
436
+*/
437
+void version_cmd(void){
438
+ printf("This is fossil version " MANIFEST_VERSION " " MANIFEST_DATE "\n");
439
+}
440
+
429441
430442
/*
431443
** COMMAND: help
432444
**
433445
** Usage: %fossil help COMMAND
@@ -438,11 +450,11 @@
438450
int rc, idx;
439451
const char *z;
440452
if( g.argc!=3 ){
441453
printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
442454
cmd_cmd_list();
443
- printf("This is fossil version " MANIFEST_VERSION " " MANIFEST_DATE "\n");
455
+ version_cmd();
444456
return;
445457
}
446458
rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
447459
if( rc==1 ){
448460
fossil_fatal("unknown command: %s", g.argv[2]);
449461
--- src/main.c
+++ src/main.c
@@ -424,10 +424,22 @@
424 aCmd[nCmd++] = aCommand[i].zName;
425 }
426 multi_column_list(aCmd, nCmd);
427 }
428
 
 
 
 
 
 
 
 
 
 
 
 
429
430 /*
431 ** COMMAND: help
432 **
433 ** Usage: %fossil help COMMAND
@@ -438,11 +450,11 @@
438 int rc, idx;
439 const char *z;
440 if( g.argc!=3 ){
441 printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
442 cmd_cmd_list();
443 printf("This is fossil version " MANIFEST_VERSION " " MANIFEST_DATE "\n");
444 return;
445 }
446 rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
447 if( rc==1 ){
448 fossil_fatal("unknown command: %s", g.argv[2]);
449
--- src/main.c
+++ src/main.c
@@ -424,10 +424,22 @@
424 aCmd[nCmd++] = aCommand[i].zName;
425 }
426 multi_column_list(aCmd, nCmd);
427 }
428
429
430 /*
431 ** COMMAND: version
432 **
433 ** Usage: %fossil version
434 **
435 ** Print the source code version number for the fossil executable.
436 */
437 void version_cmd(void){
438 printf("This is fossil version " MANIFEST_VERSION " " MANIFEST_DATE "\n");
439 }
440
441
442 /*
443 ** COMMAND: help
444 **
445 ** Usage: %fossil help COMMAND
@@ -438,11 +450,11 @@
450 int rc, idx;
451 const char *z;
452 if( g.argc!=3 ){
453 printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
454 cmd_cmd_list();
455 version_cmd();
456 return;
457 }
458 rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
459 if( rc==1 ){
460 fossil_fatal("unknown command: %s", g.argv[2]);
461

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button