Feature #18532

Better help for unsupported hammer commands

Added by Tomáš Strachota 8 months ago.

Status:New
Priority:Normal
Assigned To:-
Category:Hammer core
Target version:Foreman - Team Marek backlog
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-

Description

Hammer commands which use api endpoints that are not defined on the server (eg. newer hammer executed against older Foreman) fail correctly when one tries to execute them, but they provide empty help. We can detect such situations from apidoc (documentation for the action is missing) and print some meaningful message instead.

Example with cloning user roles:

hammer role clone
Could not clone the user role:
  Error: The server does not support such operation.

Help prints empty options, which isn't very helpful:

hammer role clone -h
Usage:
    hammer role clone [OPTIONS]

Options:
 -h, --help                    print help

We should print some informative message instead:

hammer role clone -h
Usage:
    hammer role clone [OPTIONS]

Unfortunately the server does not support such operation.


Related issues

Related to Hammer CLI - Tracker #20605: Backward compatibility support New 08/15/2017

History

#1 Updated by Tomáš Strachota 2 months ago

Also available in: Atom PDF