CLI - Support for | and >> operators

Version 6

    Support for | and >> operators

     

    Analysis

    Summary

    Aesh 1.0 comes with a set of useful operators. 2 are of particular interest in CLI:

    • In order to extend the CLI ‘>’ support with the ability to append to a file, ‘>>’ support is required.
    • To make interesting combination of commands (eg: grep, cat, less), the ‘|’ operator is required.

    Requirements

    All operations and commands (legacy or aesh based) should take benefit of these 2 operators

    The operators can be combined.

    The operator ‘>’ is still supported.

    Incorporate the Aesh Extension (GitHub - aeshell/aesh-extensions: Extensions for Aesh ) grep command into CLI. Usable in conjunction with the '|' operator.

     

     

    Pipe operator

    For commands to be the source of data (left side of the pipe), there are no special API to use. Content printed by the command will be automatically redirected to the pipe.

    For commands target of the pipe, an Aesh API is to be used to read the piped content.

    All CLI commands can be source of data for the pipe operator.

    We don’t expect to evolve existing CLI commands to become target of the pipe operator.

     

    Aesh 1.0 operators limitations

     

    - AESH-452. The same command can be used only once in a command line. For example: :read-resource | grep products | grep undefined is not supported. The grep command appears twice in the line. This limitation should be addressed in a next aesh release.

    Design Notes

    General

    Product Issue(s)

    https://issues.jboss.org/browse/EAP7-744

     

    Upstream Issue(s)

    https://issues.jboss.org/browse/WFCORE-3221

    https://issues.jboss.org/browse/WFCORE-423

    Developer Contacts

    Jean-François Denise (jdenise@redhat.com)