ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = config.rpath
+
+dist-hook:
+ echo "tarball" >$(distdir)/source
textdomain(PACKAGE);
gtk_init(&argc, &argv);
connlocal = 0;
- while((c = getopt(argc, argv, "lh")) != -1) {
+ while((c = getopt(argc, argv, "lhV")) != -1) {
switch(c) {
case 'l':
connlocal = 1;
break;
case 'h':
- printf("usage: dolcon [-hl]\n");
+ printf("usage: dolcon [-hlV]\n");
printf("\t-h\tDisplay this help message\n");
printf("\t-l\tConnect to the locally running daemon\n");
+ printf("\t-V\tDisplay version info and exit\n");
+ exit(0);
+ case 'V':
+ printf("%s", RELEASEINFO);
exit(0);
default:
- fprintf(stderr, "usage: dolcon [-hl]\n");
+ fprintf(stderr, "usage: dolcon [-hlV]\n");
exit(1);
}
}
#ifdef HAVE_NOTIFY
notify_init("Dolda Connect");
#endif
- while((c = getopt(argc, argv, "rhs:")) != -1) {
+ while((c = getopt(argc, argv, "Vrhs:")) != -1) {
switch(c) {
case 'r':
remote = 1;
printf("usage: doldacond-shell [-hr]\n");
printf("\t-h\tDisplay this help message\n");
printf("\t-r\tConnect to a remote host\n");
+ printf("\t-V\tDisplay version info and exit\n");
+ exit(0);
+ case 'V':
+ printf("%s", RELEASEINFO);
exit(0);
default:
fprintf(stderr, "usage: doldacond-shell [-hr]\n");
int c;
char cf[1024], pf[1024];
- while((c = getopt(argc, argv, "h")) != -1) {
+ while((c = getopt(argc, argv, "hV")) != -1) {
switch(c) {
case 'h':
- printf("usage: dolcon-launch [-h]\n");
+ printf("usage: dolcon-launch [-hV]\n");
printf("\t-h\tDisplay this help message\n");
+ printf("\t-V\tDisplay version info and exit\n");
printf("\n");
printf("\tIf $HOME/.doldacond.conf does not exist, dolcon-launch will run\n");
printf("\tdolconf. Otherwise, if $HOME/.doldacond.pid does not exist,\n");
printf("\tdoldacond-shell. Otherwise, dolcon-launch will run dolcon. All\n");
printf("\tthese programs must be somewhere in $PATH for dolcon-launch to work.\n");
exit(0);
- break;
+ case 'V':
+ printf("%s", RELEASEINFO);
+ exit(0);
default:
fprintf(stderr, "usage: dolcon-launch [-h]\n");
exit(1);
gtk_init(&argc, &argv);
state = -1;
- while((c = getopt(argc, argv, "haw")) != -1) {
+ while((c = getopt(argc, argv, "hawV")) != -1) {
switch(c) {
case 'a':
state = 1;
printf("\t-h\tDisplay this help message\n");
printf("\t-a\tGo directly to the assistant\n");
printf("\t-w\tGo directly to the standard window\n");
+ printf("\t-V\tDisplay version info and exit\n");
+ exit(0);
+ case 'V':
+ printf("%s", RELEASEINFO);
exit(0);
default:
- fprintf(stderr, "usage: dolconf [-haw]\n");
+ fprintf(stderr, "usage: dolconf [-hawV]\n");
exit(1);
}
}
DOLDA_AC_GROUP([Writing output])
+AH_TEMPLATE(RELEASEINFO, [define release information reported by various programs (should be left to configure to define)])
+relinfo="relver ${VERSION}\\n"
+relinfo="${relinfo}builddate $(date)\\n"
+if test -d .git && which git-rev-parse >/dev/null 2>&1; then
+ relinfo="${relinfo}source git $(git-rev-parse HEAD)\\n"
+elif test -r source; then
+ relinfo="${relinfo}source $(cat source)\\n"
+else
+ relinfo="${relinfo}source unknown\\n"
+fi
+AC_DEFINE_UNQUOTED([RELEASEINFO], ["$relinfo"])
+
AC_SUBST([extlibs])
AC_OUTPUT([
Makefile
syslogfac = LOG_DAEMON;
configfile = NULL;
pidfile = NULL;
- while((c = getopt(argc, argv, "p:C:f:hns")) != -1)
+ while((c = getopt(argc, argv, "p:C:f:hnsV")) != -1)
{
switch(c)
{
case 's':
immsyslog = 1;
break;
+ case 'V':
+ printf("%s", RELEASEINFO);
+ exit(0);
case 'h':
case ':':
case '?':
default:
- printf("usage: doldacond [-hns] [-C configfile] [-p pidfile] [-f facility]\n");
+ printf("usage: doldacond [-hnsV] [-C configfile] [-p pidfile] [-f facility]\n");
exit(c != 'h');
}
}