Skip to content

DX: Commands should be listed alphabetically in help #3784

Closed

Description

@brianneisler

This is a Bug Report

Description

Commands should be listed alphabetically when running sls --help

  • What went wrong?
    Not all commands are listed in alphabetical order.

hyper

Additional Data

  • Serverless Framework Version: 1.15.3
  • Operating System: OSX 10.12.4

Activity

  1. added this to the 1.17 milestone on Jun 12, 2017
  2. HyperBrain commented on Jun 12, 2017

    @HyperBrain
    Contributor

    Currently the commands are listed by the order of their definition. This leads to the commands being grouped by their defining plugins implicitly. IMO neither an alphabetic nor a plugin based order is right or wrong as both are discussable.
    What if we'd add a sort option to the help command, with alphabetic being the default.

  3. ryanmurakami commented on Jun 12, 2017

    @ryanmurakami
    Contributor

    I wonder if there are any metrics on which are used the most? Plugins might make that awkward, but I'd rather order a more logical way than alphabetic.

  4. brianneisler commented on Jun 12, 2017

    @brianneisler
    ContributorAuthor

    Currently the commands are listed by the order of their definition. This leads to the commands being grouped by their defining plugins implicitly.

    @HyperBrain good insights as usual 👍

    I'm not sure that the plugin based ordering is immediately obvious to the greater chunk of the user base (mainly because they're unaware that plugins and commands are related until they've really dug in to the code). I've seen this a few times now watching new users of the framework explore the commands. Their comments are "hey, your commands are out of order"

    What if we'd add a sort option to the help command, with alphabetic being the default.

    I like this as being an option. Potentially it would be nice to have them displayed under plugin headers. This seems like a feature that power users would get the most use out of, specifically plugin authors and framework maintainers.

    Maybe something to this effect?

    Commands by plugin
    
    AwsConfigCredentials
      config credentials ............ Configures a new provider profile for the Serverless Framework
    
    Config
      config ........................ Configure Serverless
    
    Create
      create ........................ Create new Serverless service
    
    Deploy
      deploy ........................ Deploy a Serverless service
      deploy function ............... Deploy a single function from the service
      deploy list ................... List deployed version of your Serverless Service
      deploy list functions ......... List all the deployed functions and their versions
    
    Info
      info .......................... Display information about the service
    
    Install
      install ....................... Install a Serverless service from GitHub
    
    Invoke
      invoke ........................ Invoke a deployed function
      invoke local .................. Invoke function locally
    
    Login
      login ......................... Login or sign up for the Serverless Platform
      logout ........................ Logout from the Serverless Platform 
    
    Logs
      logs .......................... Output the logs of a deployed function
    
    Metrics
      metrics ....................... Show metrics for a specific function
    
    Package
      package ....................... Packages a Serverless service
    
    Remove
      remove ........................ Remove Serverless service and all resources
    
    Rollback
      rollback ...................... Rollback the Serverless service to a specific deployment
      rollback function ............. Rollback the function to the previous version
    
    SlStats
      slstats ....................... Enable or disable stats
    
  5. brianneisler commented on Jun 12, 2017

    @brianneisler
    ContributorAuthor

    I wonder if there are any metrics on which are used the most? Plugins might make that awkward, but I'd rather order a more logical way than alphabetic.

    @ryanmurakami any thoughts around more useful ways of ordering? I can't think of much else other than alphabetical and grouping by plugin.

  6. HyperBrain commented on Jun 13, 2017

    @HyperBrain
    Contributor

    I like the idea with the plugin headers, Looks very structured and explanatory to me. This would also reveal quickly which plugins are installed/active.

  7. ryanmurakami commented on Jun 14, 2017

    @ryanmurakami
    Contributor

    @brianneisler Yep, love what you did. Plugin ordering makes the a lot of sense.

  8. pmuens commented on Jun 14, 2017

    @pmuens
    Contributor

    Also +1 for the headers. Only downside could be that most of our provider plugins are prefixed with the provider name. So e.g. AwsDeploy or AwsMetrics which could look a little bit ugly.

    We could filter them before displaying so that only the "core" plugins are shown (e.g. Deploy instead of AwsDeploy). But this way we would run into the problem where options which are defined only on the provider plugins won't show up in the help screen.

    Definitely smth. we should take a deeper dive into.

  9. HyperBrain commented on Jun 14, 2017

    @HyperBrain
    Contributor

    @pmuens A pragmatic solution for the names would be that every plugin gets a displayName property that is set to a human-readable name and used in the help screen instead of the class names.

  10. pmuens commented on Jun 14, 2017

    @pmuens
    Contributor

    @pmuens A pragmatic solution for the names would be that every plugin gets a displayName property that is set to a human-readable name and used in the help screen instead of the class names.

    Thats sounds like a simple and good solution 👍

  11. darkowlzz commented on Jun 21, 2017

    @darkowlzz
    Contributor

    I would like to work on this, if no one else is already working on it 😊

  12. pmuens commented on Jun 21, 2017

    @pmuens
    Contributor

    I would like to work on this, if no one else is already working on it 😊

    Awesome @darkowlzz 👍 Thanks for offering help here.

    Let us know if you need any assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions