From e8c78479ca9c7d8cc2c1d430b1f46e9ed58c0e58 Mon Sep 17 00:00:00 2001 From: Ivo van Poorten Date: Sat, 14 Dec 2013 11:28:33 +0100 Subject: [PATCH] have all tools print the version number --- rkcrc.c | 5 ++++- rkmisc | 5 +++++ rkparameters | 5 +++++ rkparametersblock | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/rkcrc.c b/rkcrc.c index 943e5e2..75824bd 100644 --- a/rkcrc.c +++ b/rkcrc.c @@ -33,6 +33,7 @@ #include #include "rkcrc.h" +#include "version.h" static const char strings[2][4] = { "KRNL", "PARM" }; @@ -50,7 +51,9 @@ int main(int argc, char *argv[]) { case 'p': which = 1; break; default: usage: - fprintf(stderr, "usage: %s [-k|-p] infile outfile\n", progname); + fprintf(stderr, "%s v%d.%d\nusage: %s [-k|-p] infile outfile\n", + progname, RKFLASHTOOL_VERSION_MAJOR, + RKFLASHTOOL_VERSION_MINOR, progname); exit(1); } } diff --git a/rkmisc b/rkmisc index e65cee4..1f2d3db 100755 --- a/rkmisc +++ b/rkmisc @@ -23,8 +23,13 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +MAJOR=`grep MAJOR version.h | { read A B C; echo $C; }` +MINOR=`grep MINOR version.h | { read A B C; echo $C; }` + test "$#" -eq 2 || { cat << __EOF__ +rkmisc v$MAJOR.$MINOR + usage: rkmisc action outfile generate a misc "partition" diff --git a/rkparameters b/rkparameters index 9c5bfa8..601ff41 100755 --- a/rkparameters +++ b/rkparameters @@ -23,8 +23,13 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +MAJOR=`grep MAJOR version.h | { read A B C; echo $C; }` +MINOR=`grep MINOR version.h | { read A B C; echo $C; }` + test "$#" -eq 3 || { cat << __EOF__ +rkparameters v$MAJOR.$MINOR + usage: rkparameters model fw_version partitionsfile e.g. rkparameters arnova7g2 1.2.3 mtdparts.txt diff --git a/rkparametersblock b/rkparametersblock index 155fd84..e4514b8 100755 --- a/rkparametersblock +++ b/rkparametersblock @@ -23,8 +23,13 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +MAJOR=`grep MAJOR version.h | { read A B C; echo $C; }` +MINOR=`grep MINOR version.h | { read A B C; echo $C; }` + test "$#" -eq 2 || { cat << __EOF__ +rkparametersblock v$MAJOR.$MINOR + usage: rkparametersblock parametersfile outfile needs rkcrc to function correctly