SQLite

Check-in [049c3c42fd]
Login

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

Overview
Comment:Include more detailed version information in the command-line shell output.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 049c3c42fdefea8de7ec7008871963e37ce2d7bc
User & Date: drh 2011-06-03 13:28:22.119
Context
2011-06-03
14:19
Hush some harmless compiler warnings in the URI parsing logic. (check-in: 0206bc6f87 user: drh tags: trunk)
13:28
Include more detailed version information in the command-line shell output. (check-in: 049c3c42fd user: drh tags: trunk)
13:06
Add shell scripts used for testing compiler warnings (tool/warnings.sh), for verifying that the library exports the correct symbols (tool/symbols.sh), and to demonstrate building a full-featured command-line shell (tool/build-shell.sh). (check-in: 3aca9a92c8 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/shell.c.
2298
2299
2300
2301
2302
2303
2304





2305
2306
2307
2308
2309
2310
2311
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316







+
+
+
+
+







    
  if( HAS_TIMER && c=='t' && n>=5 && strncmp(azArg[0], "timer", n)==0
   && nArg==2
  ){
    enableTimer = booleanValue(azArg[1]);
  }else
  
  if( c=='v' && strncmp(azArg[0], "version", n)==0 ){
    printf("SQLite %s %s\n",
        sqlite3_libversion(), sqlite3_sourceid());
  }else

  if( c=='w' && strncmp(azArg[0], "width", n)==0 && nArg>1 ){
    int j;
    assert( nArg<=ArraySize(azArg) );
    for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){
      p->colWidth[j-1] = atoi(azArg[j]);
    }
  }else
2832
2833
2834
2835
2836
2837
2838
2839

2840
2841
2842
2843
2844
2845
2846
2837
2838
2839
2840
2841
2842
2843

2844
2845
2846
2847
2848
2849
2850
2851







-
+







    }else if( strcmp(z,"-echo")==0 ){
      data.echoOn = 1;
    }else if( strcmp(z,"-stats")==0 ){
      data.statsOn = 1;
    }else if( strcmp(z,"-bail")==0 ){
      bail_on_error = 1;
    }else if( strcmp(z,"-version")==0 ){
      printf("%s\n", sqlite3_libversion());
      printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
      return 0;
    }else if( strcmp(z,"-interactive")==0 ){
      stdin_is_interactive = 1;
    }else if( strcmp(z,"-batch")==0 ){
      stdin_is_interactive = 0;
    }else if( strcmp(z,"-heap")==0 ){
      i++;
2877
2878
2879
2880
2881
2882
2883
2884

2885
2886
2887

2888
2889
2890
2891
2892
2893
2894
2882
2883
2884
2885
2886
2887
2888

2889
2890
2891

2892
2893
2894
2895
2896
2897
2898
2899







-
+


-
+







    /* Run commands received from standard input
    */
    if( stdin_is_interactive ){
      char *zHome;
      char *zHistory = 0;
      int nHistory;
      printf(
        "SQLite version %s\n"
        "SQLite version %s %.19s\n"
        "Enter \".help\" for instructions\n"
        "Enter SQL statements terminated with a \";\"\n",
        sqlite3_libversion()
        sqlite3_libversion(), sqlite3_sourceid()
      );
      zHome = find_home_dir();
      if( zHome ){
        nHistory = strlen30(zHome) + 20;
        if( (zHistory = malloc(nHistory))!=0 ){
          sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome);
        }
Changes to tool/shell1.test.
195
196
197
198
199
200
201
202
203



204
205
206
207
208
209
210
195
196
197
198
199
200
201


202
203
204
205
206
207
208
209
210
211







-
-
+
+
+







  set rc [lindex $res 0]
  list $rc \
       [regexp {Error: missing argument for option: -nullvalue} $res]
} {1 1}

# -version             show SQLite version
do_test shell1-1.16.1 {
  catchcmd "-version test.db" "" 
} {0 3.7.7}
  set x [catchcmd "-version test.db" ""]
  regexp {0 \{3.\d.\d+ 20\d\d-[01]\d-\d\d \d\d:\d\d:\d\d [0-9a-f]+\}} $x 
} 1

#----------------------------------------------------------------------------
# Test cases shell1-2.*: Basic "dot" command token parsing.
#

# check first token handling
do_test shell1-2.1.1 {