Skip to content
Snippets Groups Projects
Commit d22f9c56 authored by Martin Nilsson's avatar Martin Nilsson
Browse files

Safer handling of --query

Rev: lib/modules/Tools.pmod/Standalone.pmod/module.pike:1.11
parent 1952d802
No related branches found
No related tags found
No related merge requests found
// -*- Pike -*-
// $Id: module.pike,v 1.10 2003/03/20 11:31:35 grubba Exp $
// $Id: module.pike,v 1.11 2003/04/04 02:09:20 nilsson Exp $
constant description = "Pike module installer.";
......@@ -182,7 +182,12 @@ int main(int argc, array(string) argv)
switch(opt[0])
{
case "query":
write((opt[1]=="specs"? "%O\n":"%s\n"),this_object()[opt[1]]);
if(opt[1]=="specs")
write("%O\n", specs);
else if(stringp(this[opt[1]]))
write("%s\n", this[opt[1]]);
else
write("Unknown variable %s.\n", opt[1]);
exit(0);
case "config_args": config_args=opt[1]; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment