Project

General

Profile

Actions

Bug #12589

open

Help JSON output should be truly JSON formatted

Added by Bryan Kearney over 8 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Visibility
Target version:
-
Difficulty:
Triaged:
Yes
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1283793
Description of problem:
If a user request JSON-formatted help output from hammer, they are given all useful information as one large string within one "message" tag. The user would then have to parse that string to separate the useful information. If the output was already separated into a true JSON format, no additional processing would be needed and is already very useful.

Version-Release number of selected component (if applicable):
Nightly

How reproducible:
Always

Steps to Reproduce:
1. hammer --output=json host --help

Actual results: {
"message": "Usage:\n hammer host [OPTIONS] SUBCOMMAND [ARG] ...\n\nParameters:\n SUBCOMMAND subcommand\n [ARG] ... subcommand arguments\n\nSubcommands:\n create Create a host\n delete Delete a host\n delete-parameter Delete parameter for a host.\n facts List all fact values\n info Show a host\n interface View and manage host's network interfaces\n list List all hosts\n puppet-classes List all Puppet classes\n puppetrun Force a Puppet agent run on the host\n reboot Reboot a host\n reports List all reports\n sc-params List all smart class parameters\n set-parameter Create or update parameter for a host.\n smart-variables List all smart variables\n start Power a host on\n status Get configuration status of host\n stop Power a host off\n update Update a host\n\nOptions:\n -h, --help print help\n"
}

Expected results:
Something like {
"Usage": "hammer host [OPTIONS] SUBCOMMAND [ARG] ...",
"Parameters": {
"SUBCOMMAND": "subcommand",
"[ARG] ...": "subcommand arguments"
},
"Subcommands": {
"create": "Create a host",
"delete": "Delete a host",
"delete-parameter": "Delete parameter for a host.",
"facts": "List all fact values",
"info": "Show a host",
"interface": "View and manage host's network interfaces",
"list": "List all hosts",
"puppet-classes": "List all Puppet classes",
"puppetrun": "Force a Puppet agent run on the host",
"reboot": "Reboot a host",
"reports": "List all reports",
"sc-params": "List all smart class parameters",
"set-parameter": "Create or update parameter for a host.",
"smart-variables": "List all smart variables",
"start": "Power a host on",
"status": "Get configuration status of host",
"stop": "Power a host off",
"update": "Update a host"
}
}


Related issues 1 (0 open1 closed)

Related to Hammer CLI - Tracker #14914: Tracker for output related issuesClosed

Actions
Actions #1

Updated by Tomáš Strachota almost 8 years ago

Actions #2

Updated by Oleh Fedorenko over 4 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by Shira Maximov over 4 years ago

  • Category set to Visibility
Actions

Also available in: Atom PDF