Skip to content

Commit

Permalink
Update wiki for new strings library and new command-line-parser library.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgay committed Dec 18, 2012
1 parent d94fb39 commit a5670e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 0 additions & 2 deletions dylan/library.dylan
Expand Up @@ -19,7 +19,6 @@ define library wiki
use network;
use smtp-client;
use strings;
use string-extensions;
use system,
import: {
date,
Expand Down Expand Up @@ -87,7 +86,6 @@ define module %wiki
use streams;
use strings,
import: { find-substring, strip };
use substring-search;
use table-extensions,
rename: { table => make-table };
use threads;
Expand Down
17 changes: 8 additions & 9 deletions dylan/main.dylan
Expand Up @@ -345,15 +345,14 @@ define function add-wiki-responders
end function add-wiki-responders;

// --static-directory <dir>
add-option-parser-by-type(*argument-list-parser*,
<parameter-option-parser>,
description: "Directory containing wiki static files",
long-options: #("static-directory"));
add-option(*command-line-parser*,
make(<parameter-option>,
names: #("static-directory"),
help: "Directory containing wiki static files"));

define function initialize-wiki
(server :: <http-server>)
let directory = option-value-by-long-name(*argument-list-parser*,
"static-directory");
let directory = get-option-value(*command-line-parser*, "static-directory");
if (directory)
*static-directory* := as(<directory-locator>, directory);
*template-directory* := subdirectory-locator(*static-directory*, "dsp");
Expand Down Expand Up @@ -434,9 +433,9 @@ define function main
if (member?("--restore", application-arguments(), test: \=))
// need to handle the --config argument here so the content directory is set.
// Remove this when the old, pre-turbo wiki is dead.
let parser = *argument-list-parser*;
parse-arguments(parser, application-arguments());
let config-file = option-value-by-long-name(parser, "config");
let parser = *command-line-parser*;
parse-command-line(parser, application-arguments());
let config-file = get-option-value(parser, "config");
if (config-file)
// we just cons up a server here because all we care about is that
// the <wiki> setting is processed.
Expand Down

0 comments on commit a5670e7

Please sign in to comment.