#define m_FLAG_USAGE "[ -m module ] ..."
#endif
-#define SHORTOPTS "aAbB:c:C:dDeE:fF:G:hHi:I" j_FLAG J_FLAG "KlLm:M:nNOpqQ:r:s:StT:uUvV:w:W:xXy:Yz:Z:#"
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+#define z_FLAG "z:"
+#define z_FLAG_USAGE "[ -z postrotate-command ] "
+#else
+#define z_FLAG
+#define z_FLAG_USAGE
+#endif
+
+#ifdef HAVE_LIBCRYPTO
+#define E_FLAG "E:"
+#define E_FLAG_USAGE "[ -E algo:secret ] "
+#define M_FLAG "M:"
+#define M_FLAG_USAGE "[ -M secret ] "
+#else
+#define E_FLAG
+#define E_FLAG_USAGE
+#define M_FLAG
+#define M_FLAG_USAGE
+#endif
+
+#define SHORTOPTS "aAbB:c:C:dDe" E_FLAG "fF:G:hHi:I" j_FLAG J_FLAG "KlLm:" M_FLAG "nNOpqQ:r:s:StT:uUvV:w:W:xXy:Y" z_FLAG "Z:#"
/*
* Long options.
++ndo->ndo_eflag;
break;
+#ifdef HAVE_LIBCRYPTO
case 'E':
-#ifndef HAVE_LIBCRYPTO
- warning("crypto code not compiled in");
-#endif
ndo->ndo_espsecret = optarg;
break;
+#endif
case 'f':
++ndo->ndo_fflag;
}
break;
+#ifdef HAVE_LIBCRYPTO
case 'M':
/* TCP-MD5 shared secret */
-#ifndef HAVE_LIBCRYPTO
- warning("crypto code not compiled in");
-#endif
ndo->ndo_sigsecret = optarg;
break;
+#endif
case 'n':
++ndo->ndo_nflag;
}
break;
#endif
- case 'z':
+
#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+ case 'z':
zflag = optarg;
-#else
- error("-z cannot be used. Fork subprocess not implemented.");
-#endif
break;
+#endif
case 'Z':
username = optarg;
(void)fprintf(f,
"Usage: %s [-AbdDefhHI" J_FLAG "KlLnNOpqStuUvxX#] [ -B size ] [ -c count ] [--count]\n", program_name);
(void)fprintf(f,
-"\t\t[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]\n");
+"\t\t[ -C file_size ] " E_FLAG_USAGE "[ -F file ] [ -G seconds ]\n");
(void)fprintf(f,
"\t\t[ -i interface ]" IMMEDIATE_MODE_USAGE j_FLAG_USAGE "\n");
(void)fprintf(f,
"\t\t" m_FLAG_USAGE "\n");
#endif
(void)fprintf(f,
-"\t\t[ -M secret ] [ --number ] [ --print ]\n");
+"\t\t" M_FLAG_USAGE "[ --number ] [ --print ]\n");
(void)fprintf(f,
"\t\t[ --print-sampling nth ] [ -Q in|out|inout ] [ -r file ]\n");
(void)fprintf(f,
"\t\t[ --time-stamp-precision precision ] [ --micro ] [ --nano ]\n");
#endif
(void)fprintf(f,
-"\t\t[ -z postrotate-command ] [ -Z user ] [ expression ]\n");
+"\t\t" z_FLAG_USAGE "[ -Z user ] [ expression ]\n");
}