Wapp

Check-in [127a98314b]
Login

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

Overview
Comment:The wapptclsh executable responds to -v and --help.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 127a98314b3298788f4fe7af38e09cc067ad7a56ffc693d852358d3f151cd923
User & Date: drh 2020-10-02 19:45:04.573
Context
2020-10-07
18:24
Add the capture.tcl test script. (check-in: 00f66ee5c9 user: drh tags: trunk)
2020-10-02
19:45
The wapptclsh executable responds to -v and --help. (check-in: 127a98314b user: drh tags: trunk)
2020-08-27
18:59
Update the built-in SQLite source code to version 3.33.0. (check-in: 41c7146764 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to Makefile.
1
2
3

4
5
6
7
8
9
10
#!/usr/bin/make

CC = gcc -Os -static

OPTS = -DSQLITE_ENABLE_DESERIALIZE
TCLLIB = /home/drh/tcl/lib/libtcl8.7.a -lm -lz -lpthread -ldl
TCLINC = /home/drh/tcl/include
TCLSH = tclsh

all: wapptclsh



|
>







1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/make

CFLAGS = -Os -static
CC = gcc $(CFLAGS)
OPTS = -DSQLITE_ENABLE_DESERIALIZE
TCLLIB = /home/drh/tcl/lib/libtcl8.7.a -lm -lz -lpthread -ldl
TCLINC = /home/drh/tcl/include
TCLSH = tclsh

all: wapptclsh

Changes to wapptclsh.tcl.
1
2
3
4
5


6











7
8
9
10
11
12


13
14
15
# This script runs to initialize wapptclsh.
#
proc initialize_wapptclsh {} {
  global argv argv0 main_script
  if {[llength $argv]==0} return


  set script [lindex $argv 0]











  if {[file readable $script]} {
    set fd [open $script r]
    set main_script [read $fd]
    close $fd
    set argv [lrange $argv 1 end]
    set argv0 $script


  }
}
initialize_wapptclsh




|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|





>
>



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# This script runs to initialize wapptclsh.
#
proc initialize_wapptclsh {} {
  global argv argv0 main_script
  if {[llength $argv]==0} {
    set script --help
  } else {
    set script [lindex $argv 0]
  }
  if {[string index $script 0]=="-"} {
    set opt [string trim $script -]
    if {$opt=="v"} {
      puts stderr "Wapp using SQLite version [sqlite3 -version]"
    } else {
      puts stderr "Usage: $argv0 FILENAME"
      puts stderr "Options:"
      puts stderr "   -v      Show version information"
    }
    exit 1
  } elseif {[file readable $script]} {
    set fd [open $script r]
    set main_script [read $fd]
    close $fd
    set argv [lrange $argv 1 end]
    set argv0 $script
  } else {
    puts stderr "unknown option: \"$script\"\nthe --help option is available"
  }
}
initialize_wapptclsh