summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-04 16:12:40 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-04 16:45:48 -0300
commitb303d4644cb44f9aa351497535bef43faa159b91 (patch)
treec1ac88c6bee506dfbaf07a159fb6f7fb5f360091 /main.c
parenta09b4e2e1ef1ceb9d25488657aa805b66ac41e8a (diff)
downloadeeshow-b303d4644cb44f9aa351497535bef43faa159b91.tar.gz
eeshow-b303d4644cb44f9aa351497535bef43faa159b91.tar.bz2
eeshow-b303d4644cb44f9aa351497535bef43faa159b91.zip
eeshow/: option -H path_into_repo to list branched history of repository
Diffstat (limited to 'main.c')
-rw-r--r--main.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/main.c b/main.c
index 4c3a39c..07e7338 100644
--- a/main.c
+++ b/main.c
@@ -27,6 +27,7 @@
#include "file.h"
#include "lib.h"
#include "sch.h"
+#include "git-hist.h"
#include "gui.h"
#include "main.h"
@@ -48,11 +49,13 @@ void usage(const char *name)
"usage: %s [-r] [-v ...] [[rev:]file.lib ...] [rev:]file.sch\n"
" %*s[-- driver_spec]\n"
" %s [-v ...] -C [rev:]file\n"
+" %s [-v ...] -H path_into_repo\n"
"\n"
" rev git revision\n"
" -r recurse into sub-sheets\n"
" -v increase verbosity of diagnostic output\n"
" -C 'cat' the file to standard output\n"
+" -H show history of repository on standard output\n"
"\n"
"FIG driver spec:\n"
" fig [-t template.fig] [var=value ...]\n"
@@ -75,7 +78,7 @@ void usage(const char *name)
" diff [-o output.pdf] [-s scale] [file.lib ...] file.sch\n"
"\n"
" see PNG\n"
- , name, (int) strlen(name) + 1, "", name);
+ , name, (int) strlen(name) + 1, "", name, name);
exit(1);
}
@@ -87,6 +90,7 @@ int main(int argc, char **argv)
struct file sch_file;
bool recurse = 0;
const char *cat = NULL;
+ const char *history = NULL;
char c;
int arg, dashdash;
bool have_dashdash = 0;
@@ -102,7 +106,7 @@ int main(int argc, char **argv)
break;
}
- while ((c = getopt(dashdash, argv, "rvC:")) != EOF)
+ while ((c = getopt(dashdash, argv, "rvC:H:")) != EOF)
switch (c) {
case 'r':
recurse = 1;
@@ -113,6 +117,9 @@ int main(int argc, char **argv)
case 'C':
cat = optarg;
break;
+ case 'H':
+ history = optarg;
+ break;
default:
usage(*argv);
}
@@ -128,6 +135,14 @@ int main(int argc, char **argv)
return 0;
}
+ if (history) {
+ struct hist *h;
+
+ h = vcs_git_hist(history);
+ dump_hist(h);
+ return 0;
+ }
+
if (dashdash - optind < 1)
usage(*argv);