Karaf
  1. Karaf
  2. KARAF-638

Use the same naming convention in commands

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      In Karaf commands, we should use the same naming convention.

      For instance, we have commands looking like:
      admin:change-rmi-server-port
      admin:change-rmi-registry-port
      dev:create-dump

      and others looking like:
      roleadd
      roledel
      features:listversions

      To be clear for the users, I propose to adopt the same naming convention for all commands, like:

      role-add
      role-del
      features:list-versions

        Activity

        Hide
        Jean-Baptiste Onofré added a comment -

        For backward compatibility, the "old" styled commands could be present as aliases.

        Show
        Jean-Baptiste Onofré added a comment - For backward compatibility, the "old" styled commands could be present as aliases.
        Hide
        Achim Nierbeck added a comment -

        +1 on that, we could need a little "styleguide" for that.

        Btw. http:list-servlets was renamed to http:list since it's the only list command for http

        Show
        Achim Nierbeck added a comment - +1 on that, we could need a little "styleguide" for that. Btw. http:list-servlets was renamed to http:list since it's the only list command for http
        Hide
        Andreas Pieber added a comment -

        Basically +1 for the the style-guide and unifying all commands. What I do not like though is that we carry the burdens of the past over major versions... I would rather prefer backporting the new names, linking them their and adding a deprecated comment to them (and making it clean on 3.x)

        Show
        Andreas Pieber added a comment - Basically +1 for the the style-guide and unifying all commands. What I do not like though is that we carry the burdens of the past over major versions... I would rather prefer backporting the new names, linking them their and adding a deprecated comment to them (and making it clean on 3.x)
        Hide
        Jean-Baptiste Onofré added a comment -

        This issue is linked to the KARAF-647.

        For instance, it makes sense to define Karaf internal contexts (for instance regarding role and having role:add role:del).

        Show
        Jean-Baptiste Onofré added a comment - This issue is linked to the KARAF-647 . For instance, it makes sense to define Karaf internal contexts (for instance regarding role and having role:add role:del).
        Hide
        Christian Schneider added a comment -

        I wonder if we should use a more resouce based syntax. Currently we use the part before the colon as a kind of domain qualifier like:
        "osgi:" or "admin:". How about changing that to a resource based syntax:

        For example:

        "servers" instead of admin:list
        "servers create" instead of admin:create
        "servers.myserver" would show the details of myserver
        "servers.myserver delete" instead of admin:destroy myserver
        "servers.myserver stop" instead of admin:stop myserver
        "servers.myserver.rmiport" would show the rmi port of myserver
        "servers.myserver.rmiport 10000" would set the rmi port of myserver

        So this would be a bit like rest on the command line. Tab completion could be used to help typing the server name.

        One advantage of this is that you could create nicely looking scripts to configure stuff:

        For example:
        servers.myserver.rmiport 1001
        servers.myserver.sshport 1022

        This could even be combined with the scope ideas :
        configure server.myserver
        rmiport 1001
        sshport 1022
        exit

        For sure this syntax is not applicable for all commands but I think every crud operations around resources could benefit.

        Show
        Christian Schneider added a comment - I wonder if we should use a more resouce based syntax. Currently we use the part before the colon as a kind of domain qualifier like: "osgi:" or "admin:". How about changing that to a resource based syntax: For example: "servers" instead of admin:list "servers create" instead of admin:create "servers.myserver" would show the details of myserver "servers.myserver delete" instead of admin:destroy myserver "servers.myserver stop" instead of admin:stop myserver "servers.myserver.rmiport" would show the rmi port of myserver "servers.myserver.rmiport 10000" would set the rmi port of myserver So this would be a bit like rest on the command line. Tab completion could be used to help typing the server name. One advantage of this is that you could create nicely looking scripts to configure stuff: For example: servers.myserver.rmiport 1001 servers.myserver.sshport 1022 This could even be combined with the scope ideas : configure server.myserver rmiport 1001 sshport 1022 exit For sure this syntax is not applicable for all commands but I think every crud operations around resources could benefit.
        Hide
        Andreas Pieber added a comment -

        how would this look for the log command (for example):

        log (== log:display)
        log set TRACE (log:set TRACE)
        log exception (or rather log display exception?)
        ....

        Right?

        Basically this looks nice and remembers me somehow of git (git branch, git branch -D ...)

        Although this sounds nice I'm not sure how many changes will be required to introduce this change into the current code?

        Show
        Andreas Pieber added a comment - how would this look for the log command (for example): log (== log:display) log set TRACE (log:set TRACE) log exception (or rather log display exception?) .... Right? Basically this looks nice and remembers me somehow of git (git branch, git branch -D ...) Although this sounds nice I'm not sure how many changes will be required to introduce this change into the current code?
        Hide
        Jean-Baptiste Onofré added a comment -

        This Jira is also related to KARAF-647 about shell context.

        It makes sense to use shell context for some commands (role-add should be role/add for instance).

        Show
        Jean-Baptiste Onofré added a comment - This Jira is also related to KARAF-647 about shell context. It makes sense to use shell context for some commands (role-add should be role/add for instance).
        Hide
        Jean-Baptiste Onofré added a comment -

        As agreed on the dev mailing list some month ago, in Karaf 3.0, the commands nomenclature should be:

        scope:noun-verb

        for instance:

        dev:dump-create

        Show
        Jean-Baptiste Onofré added a comment - As agreed on the dev mailing list some month ago, in Karaf 3.0, the commands nomenclature should be: scope:noun-verb for instance: dev:dump-create

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development