Fossil

Check-in [517fe076]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:If the fossil binary is launched with no command-line arguments, check to see if there is an appended repository and if there is, run "ui" against that repository.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | use-appendvfs
Files: files | file ages | folders
SHA3-256:517fe07621ae50ae5f504901d2d5155831645ce173872db9b23f45eec998339b
User & Date: drh 2018-05-14 00:55:04
Context
2018-05-14
01:06
Handle appendvfs initialization a little differently, in a way that works on windows. Closed-Leaf check-in: 51c1276e user: drh tags: use-appendvfs
00:55
If the fossil binary is launched with no command-line arguments, check to see if there is an appended repository and if there is, run "ui" against that repository. check-in: 517fe076 user: drh tags: use-appendvfs
00:41
Update the built-in SQLite and SQLite shell to the latest 3.24.0 alpha version. check-in: a09b33d5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

   532    532     const char *zValue = find_option("comfmtflags", 0, 1);
   533    533     if( zValue ){
   534    534       g.comFmtFlags = atoi(zValue);
   535    535     }else{
   536    536       g.comFmtFlags = COMMENT_PRINT_DEFAULT;
   537    537     }
   538    538   }
          539  +
          540  +/*
          541  +** Check to see if the Fossil binary contains an appended repository
          542  +** file using the appendvfs extension.  If so, change command-line arguments
          543  +** to cause Fossil to launch with "fossil ui" on that repo.
          544  +*/
          545  +static int fossilExeHasAppendedRepo(void){
          546  +  extern int deduceDatabaseType(const char*,int);
          547  +  if( 2==deduceDatabaseType(g.nameOfExe,0) ){
          548  +    static char *azAltArgv[] = { 0, "ui", 0, 0 };
          549  +    sqlite3_appendvfs_init(0,0,0);
          550  +    g.zVfsName = "apndvfs";
          551  +    azAltArgv[0] = g.nameOfExe;
          552  +    azAltArgv[2] = g.nameOfExe;
          553  +    g.argv = azAltArgv;
          554  +    g.argc = 3;
          555  +    return 1;
          556  +  }else{
          557  +    return 0;
          558  +  }
          559  +}
   539    560   
   540    561   /*
   541    562   ** This procedure runs first.
   542    563   */
   543    564   #if defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE)
   544    565   int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */
   545    566   int wmain(int argc, wchar_t **argv)
................................................................................
   596    617       }else{
   597    618         fossil_fatal("no such VFS: \"%s\"", g.zVfsName);
   598    619       }
   599    620     }
   600    621     if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
   601    622       zCmdName = "cgi";
   602    623       g.isHTTP = 1;
   603         -  }else if( g.argc<2 ){
          624  +  }else if( g.argc<2 && !fossilExeHasAppendedRepo() ){
   604    625       fossil_print(
   605    626          "Usage: %s COMMAND ...\n"
   606    627          "   or: %s help           -- for a list of common commands\n"
   607    628          "   or: %s help COMMAND   -- for help with the named command\n",
   608    629          g.argv[0], g.argv[0], g.argv[0]);
   609    630       fossil_print(
   610    631         "\nCommands and filenames may be passed on to fossil from a file\n"