pike.git / lib / modules / Tools.pmod / Standalone.pmod / autodoc_to_html.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_html.pike:1794:    }    layout_toploop(n, exporter);       if (verbosity >= Tools.AutoDoc.FLAG_VERBOSE) {    werror("Took %d seconds.\n\n", time()-t);    }       return 0;   }    + void help(void|string err) + { +  string msg = #"pike -x autodoc_to_html [args] <input file> [<output file>] + --img=<image path> + --dest=<destination path> +  + --title=<document title> +  + --template=<template.html path> + "; +  +  if( err ) +  exit(1, err+"\n"+msg); +  write(msg); +  exit(0); + } +    int main(int num, array args) {       string title, template;       foreach(Getopt.find_all_options(args, ({    ({ "img", Getopt.HAS_ARG, "--img" }),    ({ "dest", Getopt.HAS_ARG, "--dest" }),    ({ "title", Getopt.HAS_ARG, "--title" }),    ({ "template", Getopt.HAS_ARG, "--template" }),    ({ "defns", Getopt.HAS_ARG, "--default-ns" }),
pike.git/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_html.pike:1835:    if (verbosity < Tools.AutoDoc.FLAG_DEBUG) {    verbosity += 1;    flags = (flags & ~Tools.AutoDoc.FLAG_VERB_MASK) | verbosity;    }    break;    case "quiet":    flags &= ~Tools.AutoDoc.FLAG_VERB_MASK;    verbosity = Tools.AutoDoc.FLAG_QUIET;    break;    case "help": -  write(#"pike -x autodoc_to_html [args] <input file> [<output file>] - --img=<image path> - --dest=<destination path> -  - --title=<document title> -  - --template=<template.html path> - "); +  help();    break;    }    args = Getopt.get_args(args)[1..];       if(!sizeof(args)) -  error( "No input file given.\n" ); +  { +  help( "No input file given.\n" ); +  }       if (template && Stdio.exist(template)) {    string dir = dirname(template);    html_template = Stdio.read_file(template);    Parser.HTML p = Parser.HTML();    p->add_tag("link", lambda (Parser.HTML pp, mapping attr) {    if (attr->href && attr["data-inline"]) {    return "<style>" + (Stdio.read_file(combine_path(dir, attr->href))) +    "</style>";    }    });       html_template = p->feed(html_template)->finish()->read();    }       return low_main(title, @args);   }