Skip to content
  • Jonathan Hefner's avatar
    b617a561
    Integrate Thor help features · b617a561
    Jonathan Hefner authored
    This commit refactors `Rails::Command::Base` to more closely integrate
    with Thor's help features, and to improve the base usage banner format.
    With these improvements, subclasses can generally rely on Thor to
    display nicely-formatted help.
    
    __Before (example)__
    
      ```console
      $ bin/rails db:system:change --help
      Usage:
        bin/rails change [options]
    
      Options:
        [--to=TO]  # The database system to switch to.
    
      Change `config/database.yml` and your database gem to the target database
      ```
    
    __After (example)__
    
      ```console
      $ bin/rails db:system:change --help
      Usage:
        bin/rails db:system:change
    
      Options:
        [--to=TO]  # The database system to switch to.
    
      Change `config/database.yml` and your database gem to the target database
      ```
    
    __Diff__
    
      ```diff
      @@ -1,6 +1,6 @@
       $ bin/rails db:system:change --help
       Usage:
      -  bin/rails change [options]
      +  bin/rails db:system:change
    
       Options:
         [--to=TO]  # The database system to switch to.
      ```
    b617a561
    Integrate Thor help features
    Jonathan Hefner authored
    This commit refactors `Rails::Command::Base` to more closely integrate
    with Thor's help features, and to improve the base usage banner format.
    With these improvements, subclasses can generally rely on Thor to
    display nicely-formatted help.
    
    __Before (example)__
    
      ```console
      $ bin/rails db:system:change --help
      Usage:
        bin/rails change [options]
    
      Options:
        [--to=TO]  # The database system to switch to.
    
      Change `config/database.yml` and your database gem to the target database
      ```
    
    __After (example)__
    
      ```console
      $ bin/rails db:system:change --help
      Usage:
        bin/rails db:system:change
    
      Options:
        [--to=TO]  # The database system to switch to.
    
      Change `config/database.yml` and your database gem to the target database
      ```
    
    __Diff__
    
      ```diff
      @@ -1,6 +1,6 @@
       $ bin/rails db:system:change --help
       Usage:
      -  bin/rails change [options]
      +  bin/rails db:system:change
    
       Options:
         [--to=TO]  # The database system to switch to.
      ```
Loading