Skip to content

Commit

Permalink
Added version info to output of 'cturtle -h'.
Browse files Browse the repository at this point in the history
  • Loading branch information
melgi committed Feb 2, 2016
1 parent 927b51d commit fd65fbd
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "NTriplesWriter.hh"
#include "N3PWriter.hh"
#include "Util.hh"
#include "Version.hh"


int main(int argc, char *argv[])
Expand All @@ -45,7 +46,9 @@ int main(int argc, char *argv[])
turtle::CommandLine opt = turtle::CommandLine::parse(argc, argv);

if (opt.error || opt.help) {
std::cerr << argv[0] << " [-b=base-uri] [-o=output-file] [-f=(nt|n3p|n3p-rdiv)] [input-files] " << std::endl;
std::cerr << "cturtle version " << CTURTLE_VERSION_STR << std::endl;
std::cerr << "\nUsage: cturtle [-b=base-uri] [-o=output-file] [-f=(nt|n3p|n3p-rdiv)] [input-files]" << std::endl;

return -1;
}

Expand Down
38 changes: 38 additions & 0 deletions src/Version.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// Copyright 2016 Giovanni Mels
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#ifndef CTURTLE_VERSION_HH
#define CTURTLE_VERSION_HH


#define CTURTLE_MAJOR_VERSION 1
#define CTURTLE_MINOR_VERSION 0
#define CTURTLE_PATCH_VERSION 1
//#define CTURTLE_QUALIFIER_VERSION "SNAPSHOT"



#define CTURTLE_STR(x) #x

#ifdef CTURTLE_QUALIFIER_VERSION
# define CTURTLE_VERSION(MAJ, MIN, PATCH) CTURTLE_STR(MAJ) "." CTURTLE_STR(MIN) "." CTURTLE_STR(PATCH) "-" CTURTLE_QUALIFIER_VERSION
#else
# define CTURTLE_VERSION(MAJ, MIN, PATCH) CTURTLE_STR(MAJ) "." CTURTLE_STR(MIN) "." CTURTLE_STR(PATCH)
#endif

#define CTURTLE_VERSION_STR CTURTLE_VERSION(CTURTLE_MAJOR_VERSION, CTURTLE_MINOR_VERSION, CTURTLE_PATCH_VERSION)

#endif /* CTURTLE_VERSION_HH */

0 comments on commit fd65fbd

Please sign in to comment.