Created
March 30, 2011 19:11
-
-
Save kylef/895068 to your computer and use it in GitHub Desktop.
Template generator for a znc module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: ./modgen.sh CFooMod > foo.cpp | |
# Usage: ./modgen.sh CFooMod global > foo.cpp | |
if [ ! "$1" ]; then | |
echo "No module class name supplied" | |
exit 1 | |
fi | |
classname=$1 | |
superclass=CModule | |
description="Insert description here" | |
modcontructor=MODCONSTRUCTOR | |
moddef=MODULEDEFS | |
if [ "$2" ]; then | |
superclass=CGlobalMod | |
modcontructor=MODCONSTRUCTOR | |
moddef=GLOBALMODULEDEFS | |
fi | |
echo "/* | |
* Copyright (C) 2004-2011 See the AUTHORS file for details. | |
* | |
* This program is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License version 2 as published | |
* by the Free Software Foundation. | |
*/ | |
#include \"Modules.h\" | |
class $classname : public $superclass | |
public: | |
$modcontructor($classname) {} | |
virtual ~$classname() {} | |
}; | |
$moddef($classname, \"$description\")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment