Commits

Atif Aziz committed e54820c

About/logo as a heredoc

Comments (0)

Files changed (2)

+about = """
+    WGETS 1.2  - A non-interactive web retriever script.
+    Copyright (c) Atif Aziz. All rights reserved.
+
+    Written by Atif Aziz, http://www.raboof.com/
+
+    Creative Commons Attribution-ShareAlike 3.0 Unported License.
+     http://creativecommons.org/licenses/by-sa/3.0/"""
+             
 [stdin, stdout, stderr]  = [WScript.StdIn, WScript.StdOut, WScript.StdErr]
 
-About =
-    name        : 'WGETS'
-    version     : '1.2'
-    copyright   : 'Copyright (c) Atif Aziz. All rights reserved.'
-    authors     : [ name: 'Atif Aziz', href: 'http://www.raboof.com/' ]
-    description : 'A non-interactive web retriever script.'
-    license     : 
-        title: 'Creative Commons Attribution-ShareAlike 3.0 Unported License.'
-        href : 'http://creativecommons.org/licenses/by-sa/3.0/'
-    write : (writeln) ->
-        writeln("#{@name} #{@version}  - #{@description}")
-        writeln(@copyright)
-        writeln()
-        if @authors.length
-            author = () -> "#{@name}, #{@href}"
-            if @authors.length > 1
-                writeln('Written by:')
-                writeln('- ' + author.apply(a)) for a in authors 
-            else
-                writeln('Written by ' + author.apply(@authors[0]))
-            writeln()
-        writeln(@license.title)
-        writeln(" #{@license.href}")
-        writeln()
-
 writeln = (s, w = stdout) -> w.WriteLine(s)
 write   = (s, w = stdout) -> w.Write(s)
 echo    = (s) -> WScript.Echo(s)
 
 main = (args) ->
     logo = args.isFlagged('logo')
-    About.write((s) -> writeln(s, stderr)) if logo
+    writeln(about, stderr) if logo
         
     if args.unnamed.length is 0
         return if logo
 // Generated by CoffeeScript 1.3.1
-var ADO, About, HTTP, Path, ProgramArgumentError, alert, args, echo, getFileNameFromURL, i, main, stderr, stdin, stdout, write, writeln, wsharg, wshargs, _ref,
+var ADO, HTTP, Path, ProgramArgumentError, about, alert, args, echo, getFileNameFromURL, i, main, stderr, stdin, stdout, write, writeln, wsharg, wshargs, _ref,
   __hasProp = {}.hasOwnProperty,
   __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
 
+about = "WGETS 1.2  - A non-interactive web retriever script.\nCopyright (c) Atif Aziz. All rights reserved.\n\nWritten by Atif Aziz, http://www.raboof.com/\n\nCreative Commons Attribution-ShareAlike 3.0 Unported License.\n http://creativecommons.org/licenses/by-sa/3.0/";
+
 _ref = [WScript.StdIn, WScript.StdOut, WScript.StdErr], stdin = _ref[0], stdout = _ref[1], stderr = _ref[2];
 
-About = {
-  name: 'WGETS',
-  version: '1.2',
-  copyright: 'Copyright (c) Atif Aziz. All rights reserved.',
-  authors: [
-    {
-      name: 'Atif Aziz',
-      href: 'http://www.raboof.com/'
-    }
-  ],
-  description: 'A non-interactive web retriever script.',
-  license: {
-    title: 'Creative Commons Attribution-ShareAlike 3.0 Unported License.',
-    href: 'http://creativecommons.org/licenses/by-sa/3.0/'
-  },
-  write: function(writeln) {
-    var a, author, _i, _len;
-    writeln("" + this.name + " " + this.version + "  - " + this.description);
-    writeln(this.copyright);
-    writeln();
-    if (this.authors.length) {
-      author = function() {
-        return "" + this.name + ", " + this.href;
-      };
-      if (this.authors.length > 1) {
-        writeln('Written by:');
-        for (_i = 0, _len = authors.length; _i < _len; _i++) {
-          a = authors[_i];
-          writeln('- ' + author.apply(a));
-        }
-      } else {
-        writeln('Written by ' + author.apply(this.authors[0]));
-      }
-      writeln();
-    }
-    writeln(this.license.title);
-    writeln(" " + this.license.href);
-    return writeln();
-  }
-};
-
 writeln = function(s, w) {
   if (w == null) {
     w = stdout;
   var contentLength, dontOutputEntity, headers, http, httpHeadersOnly, httpStatus, httpStatusOnly, logo, method, outputDirectory, outputFileName, outputPath, stream, url, useStandardOutput, _ref1;
   logo = args.isFlagged('logo');
   if (logo) {
-    About.write(function(s) {
-      return writeln(s, stderr);
-    });
+    writeln(about, stderr);
   }
   if (args.unnamed.length === 0) {
     if (logo) {