Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2070

Add support of !$ to recall the last command argument

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.0, 3.0.2, 2.3.8, 4.0.0.M3
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      In Unix, we can use !$ to "recall" the last command argument. It could be helpful in Karaf shell to support this, especially for commands like:

      features:addurl <url>
      features:refreshurl !$

        Activity

        Hide
        c.vanfleteren Christophe Vanfleteren added a comment -

        This is a ideally a jline feature, which already supports quite a bit of history expansion. I did the changes in jline and created a pull request at https://github.com/jline/jline2/pull/95

        I'll follow that up if it gets pulled in.

        Show
        c.vanfleteren Christophe Vanfleteren added a comment - This is a ideally a jline feature, which already supports quite a bit of history expansion. I did the changes in jline and created a pull request at https://github.com/jline/jline2/pull/95 I'll follow that up if it gets pulled in.
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        I'm testing if the JLine 2.12 update contains this feature.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - I'm testing if the JLine 2.12 update contains this feature.
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        Yup, I confirm that it works fine with JLine 2.12:

        karaf@root> la
        START LEVEL 100 , List Threshold: 0
           ID   State         Blueprint      Level  Name
        [   0] [Active     ] [            ] [    0] System Bundle (4.0.3)
        ...
        karaf@root> !$
        la
        START LEVEL 100 , List Threshold: 0
           ID   State         Blueprint      Level  Name
        [   0] [Active     ] [            ] [    0] System Bundle (4.0.3)
        ...
        
        Show
        jbonofre Jean-Baptiste Onofré added a comment - Yup, I confirm that it works fine with JLine 2.12: karaf@root> la START LEVEL 100 , List Threshold: 0 ID State Blueprint Level Name [ 0] [Active ] [ ] [ 0] System Bundle (4.0.3) ... karaf@root> !$ la START LEVEL 100 , List Threshold: 0 ID State Blueprint Level Name [ 0] [Active ] [ ] [ 0] System Bundle (4.0.3) ...
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        Confirmed on karaf-2.3.x
        Confirmed on karaf-2.x

        Show
        jbonofre Jean-Baptiste Onofré added a comment - Confirmed on karaf-2.3.x Confirmed on karaf-2.x

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development