commit b7d6608d8b33b4e9580e04f25446176bac832fb7
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Mon Sep 28 14:54:28 2015 +1000

    Fix: Tools: Repair the logging of 'interesting' command-lines

diff --git a/tools/attrd_updater.c b/tools/attrd_updater.c
index 878dab5..11462ee 100644
--- a/tools/attrd_updater.c
+++ b/tools/attrd_updater.c
@@ -150,6 +150,7 @@ main(int argc, char **argv)
             case 'v':
                 command = flag;
                 attr_value = optarg;
+                crm_log_args(argc, argv); /* Too much? */
                 break;
             default:
                 ++argerr;
diff --git a/tools/cibadmin.c b/tools/cibadmin.c
index 6b90536..c16d3c7 100644
--- a/tools/cibadmin.c
+++ b/tools/cibadmin.c
@@ -213,7 +213,7 @@ main(int argc, char **argv)
     int option_index = 0;
 
     crm_xml_init(); /* Sets buffer allocation strategy */
-    crm_log_preinit(NULL, argc, argv);
+    crm_log_cli_init("cibadmin");
     crm_set_options(NULL, "command [options] [data]", long_options,
                     "Provides direct access to the cluster configuration."
                     "\n\nAllows the configuration, or sections of it, to be queried, modified, replaced and deleted."
@@ -286,6 +286,7 @@ main(int argc, char **argv)
                 break;
             case 'B':
                 cib_action = CIB_OP_BUMP;
+                crm_log_args(argc, argv);
                 break;
             case 'V':
                 command_options = command_options | cib_verbose;
@@ -303,13 +304,16 @@ main(int argc, char **argv)
             case 'X':
                 crm_trace("Option %c => %s", flag, optarg);
                 admin_input_xml = optarg;
+                crm_log_args(argc, argv);
                 break;
             case 'x':
                 crm_trace("Option %c => %s", flag, optarg);
                 admin_input_file = optarg;
+                crm_log_args(argc, argv);
                 break;
             case 'p':
                 admin_input_stdin = TRUE;
+                crm_log_args(argc, argv);
                 break;
             case 'N':
             case 'h':
@@ -334,6 +338,7 @@ main(int argc, char **argv)
             case 'f':
                 force_flag = TRUE;
                 command_options |= cib_quorum_override;
+                crm_log_args(argc, argv);
                 break;
             case 'a':
                 output = createEmptyCib(1);
@@ -355,7 +360,6 @@ main(int argc, char **argv)
         quiet = FALSE;
     }
 
-    crm_log_init(NULL, LOG_CRIT, FALSE, FALSE, argc, argv, quiet);
     while (bump_log_num > 0) {
         crm_bump_log_level(argc, argv);
         bump_log_num--;
diff --git a/tools/crm_attribute.c b/tools/crm_attribute.c
index dadba8f..159959a 100644
--- a/tools/crm_attribute.c
+++ b/tools/crm_attribute.c
@@ -146,11 +146,15 @@ main(int argc, char **argv)
             case '?':
                 crm_help(flag, EX_OK);
                 break;
-            case 'D':
             case 'G':
+                command = flag;
+                attr_value = optarg;
+                break;
+            case 'D':
             case 'v':
                 command = flag;
                 attr_value = optarg;
+                crm_log_args(argc, argv);
                 break;
             case 'q':
             case 'Q':
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
index 2a94362..1b2976b 100644
--- a/tools/crm_resource.c
+++ b/tools/crm_resource.c
@@ -304,6 +304,7 @@ main(int argc, char **argv)
                     || safe_str_eq("force-check", longname)) {
                     rsc_cmd = flag;
                     rsc_long_cmd = longname;
+                    crm_log_args(argc, argv);
 
                 } else if (safe_str_eq("list-ocf-providers", longname)
                            || safe_str_eq("list-ocf-alternatives", longname)
@@ -433,6 +434,7 @@ main(int argc, char **argv)
                 break;
             case 'f':
                 do_force = TRUE;
+                crm_log_args(argc, argv);
                 break;
             case 'i':
                 prop_id = optarg;
@@ -452,41 +454,55 @@ main(int argc, char **argv)
             case 'T':
                 timeout_ms = crm_get_msec(optarg);
                 break;
+
             case 'C':
             case 'R':
             case 'P':
-                rsc_cmd = 'C';
+                crm_log_args(argc, argv);
                 require_resource = FALSE;
                 require_crmd = TRUE;
+                rsc_cmd = 'C';
                 break;
+
             case 'F':
-                rsc_cmd = flag;
+                crm_log_args(argc, argv);
                 require_crmd = TRUE;
+                rsc_cmd = flag;
+                break;
+
+            case 'U':
+            case 'B':
+            case 'M':
+            case 'D':
+                crm_log_args(argc, argv);
+                rsc_cmd = flag;
                 break;
+
             case 'L':
             case 'c':
             case 'l':
             case 'q':
             case 'w':
-            case 'D':
             case 'W':
-            case 'M':
-            case 'U':
-            case 'B':
             case 'O':
             case 'o':
             case 'A':
             case 'a':
                 rsc_cmd = flag;
                 break;
+
             case 'j':
                 print_pending = TRUE;
                 break;
             case 'p':
-            case 'g':
             case 'd':
             case 'S':
+                crm_log_args(argc, argv);
+                prop_name = optarg;
+                rsc_cmd = flag;
+                break;
             case 'G':
+            case 'g':
                 prop_name = optarg;
                 rsc_cmd = flag;
                 break;
