aboutsummaryrefslogtreecommitdiff
path: root/dtc.c
diff options
context:
space:
mode:
authorJon Loeliger <jdl@freescale.com>2007-07-07 13:52:25 -0500
committerJon Loeliger <jdl@freescale.com>2007-07-07 13:52:25 -0500
commita657ce8fb7da5bca364f717fb981059639dbd0d1 (patch)
tree9040c0aa0daaeacb1f4387c43c5753778dc93255 /dtc.c
parent74e6d2128439c53ad9d4a9c1613c82ee92491e84 (diff)
downloaddtc-a657ce8fb7da5bca364f717fb981059639dbd0d1.tar.gz
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.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dtc.c b/dtc.c
index 5767834..ecd9fe5 100644
--- a/dtc.c
+++ b/dtc.c
@@ -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();