diff --git a/src/CcsmOptionsHandler.cpp b/src/CcsmOptionsHandler.cpp index c8f593e..ea413b1 100755 --- a/src/CcsmOptionsHandler.cpp +++ b/src/CcsmOptionsHandler.cpp @@ -159,7 +159,7 @@ static llvm::cl::opt llvm::cl::desc("Enable condition analysis for path counting"), llvm::cl::init(false), llvm::cl::cat(CCSMToolCategory)); -static llvm::cl::extrahelp MoreHelp("\nVersion: " GEN_VER_VERSION_STRING); +static llvm::cl::extrahelp MoreHelp("\nVersion: " GEN_VER_VERSION_STRING "\n"); static void PrintVersion(llvm::raw_ostream &OS) { OS << "CCSM (https://github.com/bright-tools/ccsm):" << '\n' diff --git a/utils/gen_ver/gen_ver.py b/utils/gen_ver/gen_ver.py index 54aa01c..cbe9d76 100755 --- a/utils/gen_ver/gen_ver.py +++ b/utils/gen_ver/gen_ver.py @@ -11,19 +11,16 @@ def make_ver(git_dir=None): # Get the version string - ver = subprocess.check_output(['git', 'describe', '--match', 'v[0-9]*', '--abbrev=7', 'HEAD'], cwd=git_dir, encoding='UTF-8') - # Check for local changes - chngs = subprocess.check_output(['git', 'diff-index', '--name-only', 'HEAD', '--'], cwd=git_dir, encoding='UTF-8') + ver = subprocess.check_output(['git', 'describe', '--tags', '--match', 'v[0-9]*', '--abbrev=7', '--dirty'], + cwd=git_dir, universal_newlines=True) ver_str = ver.rstrip() - if len(chngs) > 0: - ver_str += ".dirty" txt = ["/* Generated automatically by {} */".format(os.path.basename(__file__)), '#define GEN_VER_VERSION_STRING "{}"'.format(ver_str), ] - return "\n".join(txt) + return "\n".join(txt) + "\n" class Usage(Exception):