SQLite

Check-in [0f11087b84]
Login

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

Overview
Comment:CLI shell: make (.output off) an alias for (.output /dev/null) or (.output nul), depending on the platform. Discussed in forum post 633979ce307f1cc6.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0f11087b84753576425823e10a7eeff45af02f3c0135dee72dec5019c8127500
User & Date: stephan 2025-03-28 15:36:49.069
References
2025-03-28
16:31
Correct two tests in shell1.test which were broken by the addition of new output in [0f11087b8475]. (check-in: 909dd0a02a user: stephan tags: trunk)
Context
2025-03-28
16:31
Correct two tests in shell1.test which were broken by the addition of new output in [0f11087b8475]. (check-in: 909dd0a02a user: stephan tags: trunk)
15:36
CLI shell: make (.output off) an alias for (.output /dev/null) or (.output nul), depending on the platform. Discussed in forum post 633979ce307f1cc6. (check-in: 0f11087b84 user: stephan tags: trunk)
14:32
Configure/make doc tweaks. No functional changes. (check-in: dbcc03bd7a user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/shell.c.in.
5234
5235
5236
5237
5238
5239
5240

5241
5242
5243
5244
5245
5246
5247
  "        --new           Initialize FILE to an empty database",
  "        --nofollow      Do not follow symbolic links",
  "        --readonly      Open FILE readonly",
  "        --zip           FILE is a ZIP archive",
#ifndef SQLITE_SHELL_FIDDLE
  ".output ?FILE?           Send output to FILE or stdout if FILE is omitted",
  "   If FILE begins with '|' then open it as a pipe.",

  "   Options:",
  "     --bom                 Prefix output with a UTF8 byte-order mark",
  "     -e                    Send output to the system text editor",
  "     --plain               Use text/plain for -w option",
  "     -w                    Send output to a web browser",
  "     -x                    Send output as CSV to a spreadsheet",
#endif







>







5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
  "        --new           Initialize FILE to an empty database",
  "        --nofollow      Do not follow symbolic links",
  "        --readonly      Open FILE readonly",
  "        --zip           FILE is a ZIP archive",
#ifndef SQLITE_SHELL_FIDDLE
  ".output ?FILE?           Send output to FILE or stdout if FILE is omitted",
  "   If FILE begins with '|' then open it as a pipe.",
  "   If FILE is 'off' then output is disabled.",
  "   Options:",
  "     --bom                 Prefix output with a UTF8 byte-order mark",
  "     -e                    Send output to the system text editor",
  "     --plain               Use text/plain for -w option",
  "     -w                    Send output to a web browser",
  "     -x                    Send output as CSV to a spreadsheet",
#endif
10267
10268
10269
10270
10271
10272
10273







10274

10275
10276
10277
10278
10279
10280
10281
          sqlite3_fprintf(p->out, 
                          "ERROR: unknown option: \"%s\". Usage:\n", azArg[i]);
          showHelp(p->out, azArg[0]);
          rc = 1;
          goto meta_command_exit;
        }
      }else if( zFile==0 && eMode==0 ){







        zFile = sqlite3_mprintf("%s", z);

        if( zFile && zFile[0]=='|' ){
          while( i+1<nArg ) zFile = sqlite3_mprintf("%z %s", zFile, azArg[++i]);
          break;
        }
      }else{
        sqlite3_fprintf(p->out,
            "ERROR: extra parameter: \"%s\".  Usage:\n", azArg[i]);







>
>
>
>
>
>
>
|
>







10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
          sqlite3_fprintf(p->out, 
                          "ERROR: unknown option: \"%s\". Usage:\n", azArg[i]);
          showHelp(p->out, azArg[0]);
          rc = 1;
          goto meta_command_exit;
        }
      }else if( zFile==0 && eMode==0 ){
        if( cli_strcmp(z, "off")==0 ){
#ifdef _WIN32
          zFile = sqlite3_mprintf("nul");
#else
          zFile = sqlite3_mprintf("/dev/null");
#endif
        }else{
          zFile = sqlite3_mprintf("%s", z);
        }
        if( zFile && zFile[0]=='|' ){
          while( i+1<nArg ) zFile = sqlite3_mprintf("%z %s", zFile, azArg[++i]);
          break;
        }
      }else{
        sqlite3_fprintf(p->out,
            "ERROR: extra parameter: \"%s\".  Usage:\n", azArg[i]);