From b34430b9e2d6352cd2cd0d5c866a75a79a9cf564 Mon Sep 17 00:00:00 2001 From: Nicholas O'Connor Date: Wed, 22 Mar 2017 20:42:08 -0700 Subject: [PATCH] it understands it has a version now --- .gitignore | 2 ++ src/Makefile.am | 2 +- src/cellar.cpp | 2 ++ src/version.cpp.cog | 4 +++- src/version.hpp | 4 ++++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c65f1ca..329638c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ Makefile */Makefile aclocal.m4 autom4te.cache + +src/version.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 569b6cc..45cfe27 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ bin_PROGRAMS = cellar cellar_CPPFLAGS = $(BOOST_CPPFLAGS) cellar_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) -cellar_SOURCES = cellar.cpp fs.cpp bottles.cpp commands.cpp +cellar_SOURCES = cellar.cpp fs.cpp bottles.cpp commands.cpp version.cpp diff --git a/src/cellar.cpp b/src/cellar.cpp index 2aa373a..0a50c2f 100644 --- a/src/cellar.cpp +++ b/src/cellar.cpp @@ -7,6 +7,7 @@ #include "bottles.hpp" #include "commands.hpp" +#include "version.hpp" using namespace std; using namespace cellar; @@ -15,6 +16,7 @@ using json = nlohmann::json; int main(int argc, char* argv[]) { vector commands = commands::list_commands(); cout << "cellar - bottle management tool for WINE connoisseurs" << std::endl; + cout << version::short_version() << std::endl; for (string item : commands) { cout << item << " has loaded" << endl; } diff --git a/src/version.cpp.cog b/src/version.cpp.cog index 943c5f4..e808cb6 100644 --- a/src/version.cpp.cog +++ b/src/version.cpp.cog @@ -5,7 +5,9 @@ string cellar::version::short_version() { /*[[[cog import cog - print("// I came from the print function!") + import os + + print(os.getcwd()) cog.outl("return \"dummy cog file!\";") ]]]*/ diff --git a/src/version.hpp b/src/version.hpp index fa2579a..683a84a 100644 --- a/src/version.hpp +++ b/src/version.hpp @@ -2,6 +2,10 @@ #define __VERSION_HPP #pragma once +#include + +using namespace std; + namespace cellar { namespace version { string short_version();