1 --- pwsafe1.cpp 2011-05-18 22:06:52.424328914 +0900
2 +++ pwsafe.cpp 2011-05-18 22:33:52.480699995 +0900
4 bool arg_username = false;
5 bool arg_password = false;
6 bool arg_details = false;
10 #ifndef X_DISPLAY_MISSING
12 {"display", required_argument, 0,'d'},
13 {"selection", required_argument, 0,'s'},
14 {"ignore", required_argument, 0,'G'},
15 + {"twice", no_argument, 0, '2'},
18 {"quiet", no_argument, 0, 'q'},
22 while ((c = getopt_long (argc, argv,
23 + "2" // post username/password to the clipboard twice
36 // the message getopt() printed out is good enough
38 " -d, --display=XDISPLAY override $DISPLAY (implies -x)\n"
39 " -s, --selection={Primary,Secondary,Clipboard,Both} select the X selection effected (implies -x)\n"
40 " -G, --ignore=NAME@HOST add NAME@HOST to set of windows that don't receive the selection. Either NAME or @HOST can be omitted. (default is xclipboard, wmcliphist and klipper)\n"
41 + " -2, --twice copy each value to the X selection twice\n"
43 " -q, --quiet print no extra information\n"
44 " -v, --verbose print more information (can be repeated)\n"
45 @@ -2654,10 +2661,13 @@
46 // if we're not emit()ing to stdout, then print notes before sending login/password to X clipboard.
47 // this way if the notes contain a URL, the user can cut/paste that too
49 + const int times = (!arg_echo && twice) ? 2 : 1;
52 + for(int i = 0; i < times; ++i)
53 ::emit(e.groupname(), "username", e.default_login?e.the_default_login:e.login);
55 + for(int i = 0; i < times; ++i)
56 ::emit(e.groupname(), "password", e.password);
58 if (arg_echo && arg_details)