nostalgia/scripts/newcpp

16 lines
377 B
Plaintext
Raw Normal View History

2016-03-26 15:49:05 -05:00
#! /usr/bin/env python
import sys
if len(sys.argv) < 3:
sys.exit(1)
pkg = sys.argv[1]
name = sys.argv[2]
2017-04-16 01:00:50 -05:00
namespace = "namespace nostalgia {\nnamespace %s {\n\n}\n}" % pkg
2017-04-04 19:21:29 -05:00
hpp = "#pragma once\n"
2016-03-26 15:49:05 -05:00
cpp = "#include \"%s.hpp\"\n\n%s" % (name, namespace)
2017-11-09 21:43:59 -06:00
open("src/nostalgia/%s/%s.hpp" % (pkg, name), "w").write(hpp)
open("src/nostalgia/%s/%s.cpp" % (pkg, name), "w").write(cpp)