Dan Gora
2013-03-22 00:15:45 UTC
Fixed the formatting of the help command to make it clearer what
options the sdr command has.
Signed-off-by: Dan Gora <***@adax.com>
---
ipmitool/lib/ipmi_sdr.c | 71 +++++++++++++++++++++++++++++------------------
1 files changed, 44 insertions(+), 27 deletions(-)
diff --git a/ipmitool/lib/ipmi_sdr.c b/ipmitool/lib/ipmi_sdr.c
index 698f051..272dee0 100644
--- a/ipmitool/lib/ipmi_sdr.c
+++ b/ipmitool/lib/ipmi_sdr.c
@@ -3743,7 +3743,7 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
}
/* now keep looking */
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL){
uint8_t *rec;
struct sdr_record_list *sdrr;
@@ -4406,6 +4406,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
}
}
if (sensor_type != x) {
+ printf("Sensor Type %s not found.\n", type);
printf("Sensor Types:\n");
for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
printf("\t%-25s %-25s\n",
@@ -4552,49 +4553,65 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
if (argc == 0)
return ipmi_sdr_print_sdr(intf, 0xfe);
else if (strncmp(argv[0], "help", 4) == 0) {
+ lprintf(LOG_ERR, "SDR Commands:");
lprintf(LOG_ERR,
- "SDR Commands: list | elist [all|full|compact|event|mcloc|fru|generic]");
+ " list | elist [option]. Available options are:");
lprintf(LOG_ERR,
- " all All SDR Records");
+ " all All SDR Records");
lprintf(LOG_ERR,
- " full Full Sensor Record");
+ " full Full Sensor Record");
lprintf(LOG_ERR,
- " compact Compact Sensor Record");
+ " compact Compact Sensor Record");
lprintf(LOG_ERR,
- " event Event-Only Sensor Record");
+ " event Event-Only Sensor Record");
lprintf(LOG_ERR,
- " mcloc Management Controller Locator Record");
+ " mcloc Management Controller Locator Record");
lprintf(LOG_ERR,
- " fru FRU Locator Record");
+ " fru FRU Locator Record");
lprintf(LOG_ERR,
- " generic Generic Device Locator Record");
- lprintf(LOG_ERR, " type [sensor type]");
+ " generic Generic Device Locator Record");
+ lprintf(LOG_ERR,
+ " type [sensor type] | list");
lprintf(LOG_ERR,
- " list Get a list of available sensor types");
+ " Retrieve sensors matching [sensor type]");
lprintf(LOG_ERR,
- " get Retrieve the state of a specified sensor");
-
- lprintf(LOG_ERR, " info");
+ " list Get a list of available sensor types");
lprintf(LOG_ERR,
- " Display information about the repository itself");
- lprintf(LOG_ERR, " entity <id>[.<instance>]");
+ " get");
lprintf(LOG_ERR,
- " Display all sensors associated with an entity");
- lprintf(LOG_ERR, " dump <file>");
+ " Retrieve the state of a specified sensor");
+ lprintf(LOG_ERR,
+ " info");
lprintf(LOG_ERR,
- " Dump raw SDR data to a file");
- lprintf(LOG_ERR, " fill");
+ " Display information about the repository itself");
+ lprintf(LOG_ERR,
+ " entity <id>[.<instance>]");
lprintf(LOG_ERR,
- " sensors Creates the SDR repository for the current configuration");
+ " Display all sensors associated with an entity");
+ lprintf(LOG_ERR,
+ " dump <file>");
lprintf(LOG_ERR,
- " nosat Creates the SDR repository for the current configuration, without satellite scan");
-
+ " Dump raw SDR data to a file");
+ lprintf(LOG_ERR,
+ " fill [option]. Available options:");
+ lprintf(LOG_ERR,
+ " sensors Creates the SDR repository for the current");
+ lprintf(LOG_ERR,
+ " configuration.");
+ lprintf(LOG_ERR,
+ " nosat Creates the SDR repository for the current");
+ lprintf(LOG_ERR,
+ " configuration, without satellite scan.");
+ lprintf(LOG_ERR,
+ " file <file> Load SDR repository from a file");
+ lprintf(LOG_ERR,
+ " range <range> Load SDR repository from a provided list");
lprintf(LOG_ERR,
- " file <file> Load SDR repository from a file");
+ " or range");
lprintf(LOG_ERR,
- " range <range> Load SDR repository from a provided list or range");
+ " Use , for list or - for range");
lprintf(LOG_ERR,
- " - Use , for list or - for range (Ex.: 0x28,0x32,0x40-0x44) ");
+ " (Ex.: 0x28,0x32,0x40-0x44) ");
} else if (strncmp(argv[0], "list", 4) == 0
|| strncmp(argv[0], "elist", 5) == 0) {
@@ -4661,7 +4678,7 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
rc = -1;
} else if (strncmp(argv[1], "sensors", 7) == 0) {
rc = ipmi_sdr_add_from_sensors(intf, 21);
- } else if (strncmp(argv[1], "nosats", 6) == 0) {
+ } else if (strncmp(argv[1], "nosat", 5) == 0) {
rc = ipmi_sdr_add_from_sensors(intf, 0);
} else if (strncmp(argv[1], "file", 4) == 0) {
if (argc < 3) {
options the sdr command has.
Signed-off-by: Dan Gora <***@adax.com>
---
ipmitool/lib/ipmi_sdr.c | 71 +++++++++++++++++++++++++++++------------------
1 files changed, 44 insertions(+), 27 deletions(-)
diff --git a/ipmitool/lib/ipmi_sdr.c b/ipmitool/lib/ipmi_sdr.c
index 698f051..272dee0 100644
--- a/ipmitool/lib/ipmi_sdr.c
+++ b/ipmitool/lib/ipmi_sdr.c
@@ -3743,7 +3743,7 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
}
/* now keep looking */
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL){
uint8_t *rec;
struct sdr_record_list *sdrr;
@@ -4406,6 +4406,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
}
}
if (sensor_type != x) {
+ printf("Sensor Type %s not found.\n", type);
printf("Sensor Types:\n");
for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
printf("\t%-25s %-25s\n",
@@ -4552,49 +4553,65 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
if (argc == 0)
return ipmi_sdr_print_sdr(intf, 0xfe);
else if (strncmp(argv[0], "help", 4) == 0) {
+ lprintf(LOG_ERR, "SDR Commands:");
lprintf(LOG_ERR,
- "SDR Commands: list | elist [all|full|compact|event|mcloc|fru|generic]");
+ " list | elist [option]. Available options are:");
lprintf(LOG_ERR,
- " all All SDR Records");
+ " all All SDR Records");
lprintf(LOG_ERR,
- " full Full Sensor Record");
+ " full Full Sensor Record");
lprintf(LOG_ERR,
- " compact Compact Sensor Record");
+ " compact Compact Sensor Record");
lprintf(LOG_ERR,
- " event Event-Only Sensor Record");
+ " event Event-Only Sensor Record");
lprintf(LOG_ERR,
- " mcloc Management Controller Locator Record");
+ " mcloc Management Controller Locator Record");
lprintf(LOG_ERR,
- " fru FRU Locator Record");
+ " fru FRU Locator Record");
lprintf(LOG_ERR,
- " generic Generic Device Locator Record");
- lprintf(LOG_ERR, " type [sensor type]");
+ " generic Generic Device Locator Record");
+ lprintf(LOG_ERR,
+ " type [sensor type] | list");
lprintf(LOG_ERR,
- " list Get a list of available sensor types");
+ " Retrieve sensors matching [sensor type]");
lprintf(LOG_ERR,
- " get Retrieve the state of a specified sensor");
-
- lprintf(LOG_ERR, " info");
+ " list Get a list of available sensor types");
lprintf(LOG_ERR,
- " Display information about the repository itself");
- lprintf(LOG_ERR, " entity <id>[.<instance>]");
+ " get");
lprintf(LOG_ERR,
- " Display all sensors associated with an entity");
- lprintf(LOG_ERR, " dump <file>");
+ " Retrieve the state of a specified sensor");
+ lprintf(LOG_ERR,
+ " info");
lprintf(LOG_ERR,
- " Dump raw SDR data to a file");
- lprintf(LOG_ERR, " fill");
+ " Display information about the repository itself");
+ lprintf(LOG_ERR,
+ " entity <id>[.<instance>]");
lprintf(LOG_ERR,
- " sensors Creates the SDR repository for the current configuration");
+ " Display all sensors associated with an entity");
+ lprintf(LOG_ERR,
+ " dump <file>");
lprintf(LOG_ERR,
- " nosat Creates the SDR repository for the current configuration, without satellite scan");
-
+ " Dump raw SDR data to a file");
+ lprintf(LOG_ERR,
+ " fill [option]. Available options:");
+ lprintf(LOG_ERR,
+ " sensors Creates the SDR repository for the current");
+ lprintf(LOG_ERR,
+ " configuration.");
+ lprintf(LOG_ERR,
+ " nosat Creates the SDR repository for the current");
+ lprintf(LOG_ERR,
+ " configuration, without satellite scan.");
+ lprintf(LOG_ERR,
+ " file <file> Load SDR repository from a file");
+ lprintf(LOG_ERR,
+ " range <range> Load SDR repository from a provided list");
lprintf(LOG_ERR,
- " file <file> Load SDR repository from a file");
+ " or range");
lprintf(LOG_ERR,
- " range <range> Load SDR repository from a provided list or range");
+ " Use , for list or - for range");
lprintf(LOG_ERR,
- " - Use , for list or - for range (Ex.: 0x28,0x32,0x40-0x44) ");
+ " (Ex.: 0x28,0x32,0x40-0x44) ");
} else if (strncmp(argv[0], "list", 4) == 0
|| strncmp(argv[0], "elist", 5) == 0) {
@@ -4661,7 +4678,7 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
rc = -1;
} else if (strncmp(argv[1], "sensors", 7) == 0) {
rc = ipmi_sdr_add_from_sensors(intf, 21);
- } else if (strncmp(argv[1], "nosats", 6) == 0) {
+ } else if (strncmp(argv[1], "nosat", 5) == 0) {
rc = ipmi_sdr_add_from_sensors(intf, 0);
} else if (strncmp(argv[1], "file", 4) == 0) {
if (argc < 3) {
--
1.7.7
1.7.7