Uploaded image for project: 'Spring Shell'
  1. Spring Shell
  2. SHL-175

Allow a command result to be printed multiple ways through type conversion

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.1.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Spring Shell's AbstractShell's handleExecutionResult method logs the toString() output of a command result.

      Therefore for a command to support outputting multiple formats of the same result, the options include:

      • Override the result instance's toString() method with switch logic
      • Write multiple commands with different return types

      A more preferable solution would to be separate the command result from the presentation format.

      A suggested solution is to, like @CliOption, provide an annotation denoting the command input that may be used to specify an output. Then, Spring Type Conversion could piggyback off Spring Shell's type conversion to apply a transformation on the command result.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              robinhowlett Robin Howlett
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: