diff -r d163c8917af7 ii.1 --- a/ii.1 Mon Oct 31 21:35:12 2011 +0100 +++ b/ii.1 Thu Apr 19 17:42:30 2012 -0500 @@ -27,6 +27,8 @@ .IR port ] .RB [ \-k .IR password ] +.RB [ \-j +.IR password_file ] .RB [ \-i .IR prefix ] .RB [ \-n @@ -47,6 +49,9 @@ (be aware of the problem that this is visible in the process list, if you don't want this use a query to submit your password) .TP +.BI \-j " password_file" +lets one use password from file, lest it be read by another user in task list +.TP .BI \-i " prefix" lets you override the default irc path (~/irc) .TP diff -r d163c8917af7 ii.c --- a/ii.c Mon Oct 31 21:35:12 2011 +0100 +++ b/ii.c Thu Apr 19 17:42:30 2012 -0500 @@ -478,6 +478,26 @@ case 'p': port = strtol(argv[++i], NULL, 10); break; case 'n': snprintf(nick,sizeof(nick),"%s", argv[++i]); break; case 'k': key = argv[++i]; break; + case 'j': { + FILE *keyfile; + int n; + i += 1; + keyfile = 0 == strcmp (argv[i], "-") ? stdin : fopen (argv[i], "r"); + if (keyfile == 0) { + perror (argv[i]); + exit (EXIT_FAILURE); + } + for (n = 0; ! feof (keyfile); n++) { + key = realloc (key, n+1); + if (key == 0) { + fprintf (stderr, "Failed to allocate memory\n"); + exit (EXIT_FAILURE); + } + key[n] = fgetc (keyfile); + } + key[n] = '\0'; + fclose (keyfile); + }; break; case 'f': fullname = argv[++i]; break; default: usage(); break; }