empire \- Empire client
.SH SYNOPSIS
.B empire
-[\fB\-hHkruv\fP]
+[\fB\-hkruv\fP]
[\fB\-2\fP \fIoutfile\fP]
+[\fB\-H\fP \fIhistfile\fP]
[\fB\-s\fP \fI[host:]port\fP]
[\fIcountry\fP
[\fIpassword\fP]]
.B \-h
Help. Print brief usage information and exit.
.TP
-.B \-H
-Save readline command history to file.
+.BI \-H " histfile"
+Load command history from \fIhistfile\fP, and save it back. Default
+is '~/.empire_history' without \fB\-r\fP, and none with \fB-r\fP. You
+might want to protect your history file from prying eyes.
.IP
Only available when compiled the GNU \fBreadline\fP library.
.TP
default of \fI~/.inputrc\fP (see \fBREADLINE\fP below).
.SH READLINE
When compiled with the GNU \fBreadline\fP library, the client supports
-fancy line editing and, with option \fB-H\fP, persistent history. See
-the readline documentation for details.
+fancy line editing and persistent history. See the readline
+documentation for details.
.SH "SEE ALSO"
\fIemp_server\fR(6), \fIreadline\fR(3).
.SH FILES
" -s [HOST:]PORT Specify server HOST and PORT\n"
" -u Use UTF-8\n"
#ifdef HAVE_LIBREADLINE
- " -H Save readline command history to file\n"
+ " -H FILE Load and save command history from FILE\n"
+ " (default ~/.empire_history with -r, none without -r)\n"
#endif /* HAVE_LIBREADLINE */
" -h display this help and exit\n"
" -v display version information and exit\n",
{
int opt;
char *auxfname = NULL;
- int use_history_file = 0;
+ char *history_file = NULL;
int send_kill = 0;
char *host = NULL;
char *port = NULL;
char *udir;
char *colon;
int sock;
- char *history_file;
- while ((opt = getopt(argc, argv, "2:Hkrs:uhv")) != EOF) {
+ while ((opt = getopt(argc, argv, "2:H:krs:uhv")) != EOF) {
switch (opt) {
case '2':
auxfname = optarg;
break;
#ifdef HAVE_LIBREADLINE
case 'H':
- use_history_file = 1;
+ history_file = optarg;
break;
#endif /* HAVE_LIBREADLINE */
case 'k':
sock = tcp_connect(host, port);
- if (use_history_file)
- history_file = fnameat(".empire_history", udir);
+ if (!restricted && !history_file)
+ history_file = ".empire_history";
+ if (history_file)
+ history_file = fnameat(history_file, udir);
if (!login(sock, uname, country, passwd, send_kill, utf8))
exit(1);