+/**
+ * Output information about nodemaps.
+ * \param argc number of args
+ * \param argv[] variable string arguments
+ *
+ * [list|nodemap_name|all] \a list will list all nodemaps (default).
+ * Specifying a \a nodemap_name will
+ * display info about that specific nodemap.
+ * \a all will display info for all nodemaps.
+ * \retval 0 on success
+ */
+int jt_nodemap_info(int argc, char **argv)
+{
+ const char usage_str[] = "usage: nodemap_info "
+ "[list|nodemap_name|all]\n";
+ struct param_opts popt = {
+ .po_only_path = 0,
+ .po_show_path = 1,
+ .po_show_type = 0,
+ .po_recursive = 0,
+ .po_only_dir = 0
+ };
+ int rc = 0;
+
+ if (argc > 2) {
+ fprintf(stderr, usage_str);
+ return -1;
+ }
+
+ if (argc == 1 || strcmp("list", argv[1]) == 0) {
+ popt.po_only_path = 1;
+ popt.po_only_dir = 1;
+ rc = listparam_display(&popt, "nodemap/*");
+ } else if (strcmp("all", argv[1]) == 0) {
+ rc = getparam_display(&popt, "nodemap/*/*");
+ } else {
+ char pattern[PATH_MAX];
+
+ snprintf(pattern, sizeof(pattern), "nodemap/%s/*", argv[1]);
+ rc = getparam_display(&popt, pattern);
+ if (rc == -ESRCH)
+ fprintf(stderr, "error: nodemap_info: cannot find"
+ "nodemap %s\n", argv[1]);
+ }
+ return rc;
+}
+
+