Karaf
  1. Karaf
  2. KARAF-1029

Add completer support on option values

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.5, 3.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      Currently, Karaf console provides completion on the option name.

      As discussed with Ioannis, it could be interesting to add completer support for option values.

      For instance, mycommand --config where the user can specify a configuration PID in the config option, it could be helpful to have completion for the PID.

      The proposal is to use a new annotation for option, for instance:

      @Option
      @Completer(type = ConfigCompleter.class)

        Activity

        Hide
        Ioannis Canellos added a comment -

        Committed on trunk

        Show
        Ioannis Canellos added a comment - Committed on trunk
        Hide
        Ioannis Canellos added a comment -

        Guillaume proposed this great idea on irc:

        <gnodet> iocanel: about options completers, wouldn't it make more sense to have a map and identify them by the option name rather than the completer class name ?
        <gnodet> iocanel: it seems to me that you could very well have multiple options with the same completers class
        <gnodet> (even if configured with different values)
        <iocanel> gnodet, makes sense to me
        <gnodet> so i'd remove the completer from @Option and use something like <optional-completers><key value="-furl" ref="allFeatureCompleter">...</
        <gnodet> and then the code would try to find the correct completer
        <iocanel> gnodet, yes it will be much better this way

        The suggestion is committed to trunk.

        Show
        Ioannis Canellos added a comment - Guillaume proposed this great idea on irc: <gnodet> iocanel: about options completers, wouldn't it make more sense to have a map and identify them by the option name rather than the completer class name ? <gnodet> iocanel: it seems to me that you could very well have multiple options with the same completers class <gnodet> (even if configured with different values) <iocanel> gnodet, makes sense to me <gnodet> so i'd remove the completer from @Option and use something like <optional-completers><key value="-furl" ref="allFeatureCompleter">...</ <gnodet> and then the code would try to find the correct completer <iocanel> gnodet, yes it will be much better this way The suggestion is committed to trunk.

          People

          • Assignee:
            Ioannis Canellos
            Reporter:
            Jean-Baptiste Onofré
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development