@@ -15,11 +15,11 @@ foreach error $errors { puts $channel "error: $error" } puts $channel "" } - puts $channel "Usage: dir2c \[--help\] \[--set-mode {flexible|standalone|client}\] \[--output \] --directory --name " + puts $channel "Usage: xvfs-create \[--help\] \[--static-init {true|false}\] \[--set-mode {flexible|standalone|client}\] \[--output \] --directory --name " flush $channel } proc ::xvfs::sanitizeCString {string} { set output [join [lmap char [split $string ""] { @@ -235,10 +235,11 @@ ## 1. Parse arguments if {[llength $argv] % 2 != 0} { lappend argv "" } + set staticInit false foreach {arg val} $argv { switch -exact -- $arg { "--help" { printHelp stdout exit 0 @@ -247,10 +248,13 @@ set rootDirectory $val } "--name" { set fsName $val } + "--static-init" { + set staticInit $val + } "--output" - "--header" - "--set-mode" { # Ignored, handled as part of some other process } default { printHelp stderr [list "Invalid option: $arg $val"] @@ -271,11 +275,16 @@ if {[llength $errors] != 0} { printHelp stderr $errors exit 1 } - ## 3. Start processing directory and producing initial output + ## 3. Initialization + if {$staticInit} { + ::xvfs::_emitLine "#define XVFS_${fsName}_INIT_STATIC 1" + } + + ## 4. Start processing directory and producing initial output set ::xvfs::outputFiles [processDirectory $fsName $rootDirectory] set ::xvfs::fsName $fsName set ::xvfs::rootDirectory $rootDirectory