diff options
author | Jon Loeliger <jdl@freescale.com> | 2007-07-07 13:52:25 -0500 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-07-07 13:52:25 -0500 |
commit | a657ce8fb7da5bca364f717fb981059639dbd0d1 (patch) | |
tree | 9040c0aa0daaeacb1f4387c43c5753778dc93255 /dtc.c | |
parent | 74e6d2128439c53ad9d4a9c1613c82ee92491e84 (diff) | |
download | dtc-a657ce8fb7da5bca364f717fb981059639dbd0d1.zip dtc-a657ce8fb7da5bca364f717fb981059639dbd0d1.tar.gz dtc-a657ce8fb7da5bca364f717fb981059639dbd0d1.tar.bz2 |
Add DTC release version information.
Adopted the version information and implementation
from of the Linux Kernel Makefiles.
Signed-off-by: Jon Loeliger <jdl@jdl.com>
Diffstat (limited to 'dtc.c')
-rw-r--r-- | dtc.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -21,6 +21,8 @@ #include "dtc.h" #include "srcpos.h" +#include "version_gen.h" + /* * Command line options */ @@ -99,6 +101,8 @@ static void usage(void) fprintf(stderr, "\t\tSet the physical boot cpu\n"); fprintf(stderr, "\t-f\n"); fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n"); + fprintf(stderr, "\t-v\n"); + fprintf(stderr, "\t\tPrint DTC version and exit\n"); exit(2); } @@ -120,7 +124,7 @@ int main(int argc, char *argv[]) reservenum = 0; minsize = 0; - while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:fqb:")) != EOF) { + while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:fqb:v")) != EOF) { switch (opt) { case 'I': inform = optarg; @@ -149,6 +153,9 @@ int main(int argc, char *argv[]) case 'b': boot_cpuid_phys = strtol(optarg, NULL, 0); break; + case 'v': + printf("Version: %s\n", DTC_VERSION); + exit(0); case 'h': default: usage(); |