From c4f621d0e85ab07b7d3039b292c10fa742cea13d Mon Sep 17 00:00:00 2001 From: Giacomo Fiorin Date: Fri, 11 Oct 2024 16:37:49 -0400 Subject: [PATCH] Add patchversion scripting command --- doc/cvscript-fix-modify.tex | 11 ++++++++++- doc/cvscript-tcl.tex | 11 ++++++++++- src/colvarscript_commands.h | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/doc/cvscript-fix-modify.tex b/doc/cvscript-fix-modify.tex index c1ab5dcde..79c45c230 100644 --- a/doc/cvscript-fix-modify.tex +++ b/doc/cvscript-fix-modify.tex @@ -305,6 +305,15 @@ \-~~~~\texttt{values : string - The values} \end{mdexampleinput} \begin{mdexampleinput}{} +\texttt{\textbf{fix\_modify Colvars patchversion}} +\\ +\-~~~~\texttt{Get the Colvars patch version string (used for bugfixes only)} +\\ +\-~~~~\texttt{\textbf{Returns}} +\\ +\-~~~~\texttt{version : string - Colvars version} +\end{mdexampleinput} +\begin{mdexampleinput}{} \texttt{\textbf{fix\_modify Colvars printframelabels}} \\ \-~~~~\texttt{Return the labels that would be written to colvars.traj} @@ -388,7 +397,7 @@ \begin{mdexampleinput}{} \texttt{\textbf{fix\_modify Colvars version}} \\ -\-~~~~\texttt{Get the Colvars Module version string} +\-~~~~\texttt{Get the Colvars version string} \\ \-~~~~\texttt{\textbf{Returns}} \\ diff --git a/doc/cvscript-tcl.tex b/doc/cvscript-tcl.tex index 1092a030c..913ab3e48 100644 --- a/doc/cvscript-tcl.tex +++ b/doc/cvscript-tcl.tex @@ -305,6 +305,15 @@ \-~~~~\texttt{values : string - The values} \end{mdexampleinput} \begin{mdexampleinput}{} +\texttt{\textbf{cv patchversion}} +\\ +\-~~~~\texttt{Get the Colvars patch version string (used for bugfixes only)} +\\ +\-~~~~\texttt{\textbf{Returns}} +\\ +\-~~~~\texttt{version : string - Colvars version} +\end{mdexampleinput} +\begin{mdexampleinput}{} \texttt{\textbf{cv printframelabels}} \\ \-~~~~\texttt{Return the labels that would be written to colvars.traj} @@ -388,7 +397,7 @@ \begin{mdexampleinput}{} \texttt{\textbf{cv version}} \\ -\-~~~~\texttt{Get the Colvars Module version string} +\-~~~~\texttt{Get the Colvars version string} \\ \-~~~~\texttt{\textbf{Returns}} \\ diff --git a/src/colvarscript_commands.h b/src/colvarscript_commands.h index bdad74e43..f618bd805 100644 --- a/src/colvarscript_commands.h +++ b/src/colvarscript_commands.h @@ -541,6 +541,15 @@ CVSCRIPT(cv_printframe, return COLVARS_OK; ) +CVSCRIPT(cv_patchversion, + "Get the Colvars patch version string (used for bugfixes only)\n" + "version : string - Colvars version", + 0, 0, + "", + script->set_result_int(cvm::main()->patch_version_number()); + return COLVARS_OK; + ) + CVSCRIPT(cv_printframelabels, "Return the labels that would be written to colvars.traj\n" "Labels : string - The labels", @@ -656,7 +665,7 @@ CVSCRIPT(cv_update, ) CVSCRIPT(cv_version, - "Get the Colvars Module version string\n" + "Get the Colvars version string\n" "version : string - Colvars version", 0, 0, "",