Skip to content
  • Jonathan Hefner's avatar
    91a5b084
    Integrate various commands with Thor's help system · 91a5b084
    Jonathan Hefner authored
    This modifies a handful of commands to better integrate with Thor's help
    system.
    
    __Before (examples)__
    
      ```console
      $ bin/rails dbconsole --help
      Usage:
        bin/rails dbconsole
    
      Options:
        -e, [--environment=ENVIRONMENT]                    # The environment to run `dbconsole` in (e.g. test / development / production).
        -p, [--include-password], [--no-include-password]  # Automatically provide the password from database.yml
            [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode (html, list, line, column).
                                                           # Possible values: html, list, line, column
            [--header], [--no-header]
        --db, [--database=DATABASE]                        # Specifies the database to use.
    
      $ bin/rails server --help
      Usage:
        bin/rails server -u [thin/puma/webrick] [options]
    
      Options:
        -e, [--environment=ENVIRONMENT]              # The environment to run `server` in (e.g. test / development / production).
        -p, [--port=port]                            # Runs Rails on the specified port - defaults to 3000.
        -b, [--binding=IP]                           # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.
        -c, [--config=file]                          # Uses a custom rackup configuration.
                                                     # Default: config.ru
        -d, [--daemon], [--no-daemon]                # Runs server as a Daemon.
        -u, [--using=name]                           # Specifies the Rack server used to run the application (thin/puma/webrick).
        -P, [--pid=PID]                              # Specifies the PID file - defaults to tmp/pids/server.pid.
        -C, [--dev-caching], [--no-dev-caching]      # Specifies whether to perform caching in development.
            [--early-hints], [--no-early-hints]      # Enables HTTP/2 early hints.
            [--log-to-stdout], [--no-log-to-stdout]  # Whether to log to stdout. Enabled by default in development when not daemonized.
      ```
    
    __After (examples)__
    
      ```console
      $ bin/rails dbconsole --help
      Usage:
        bin/rails dbconsole
    
      Options:
        -e, [--environment=ENVIRONMENT]                    # The environment to run `dbconsole` in (e.g. test / development / production).
        -p, [--include-password], [--no-include-password]  # Automatically provide the password from database.yml
            [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode
                                                           # Possible values: html, list, line, column
            [--header], [--no-header]
        --db, [--database=DATABASE]                        # Specifies the database to use.
    
      Start a console for the database specified in config/database.yml
    
      $ bin/rails server --help
      Usage:
        bin/rails server
    
      Options:
        -e, [--environment=ENVIRONMENT]              # The environment to run `server` in (e.g. test / development / production).
        -p, [--port=port]                            # Runs Rails on the specified port - defaults to 3000.
        -b, [--binding=IP]                           # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.
        -c, [--config=file]                          # Uses a custom rackup configuration.
                                                     # Default: config.ru
        -d, [--daemon], [--no-daemon]                # Runs server as a Daemon.
        -u, [--using=name]                           # Specifies the Rack server used to run the application (thin/puma/webrick).
        -P, [--pid=PID]                              # Specifies the PID file - defaults to tmp/pids/server.pid.
        -C, [--dev-caching], [--no-dev-caching]      # Specifies whether to perform caching in development.
            [--early-hints], [--no-early-hints]      # Enables HTTP/2 early hints.
            [--log-to-stdout], [--no-log-to-stdout]  # Whether to log to stdout. Enabled by default in development when not daemonized.
    
      Start the Rails server
      ```
    
    __Diff__
    
      ```diff
      @@ -5,14 +5,16 @@
       Options:
         -e, [--environment=ENVIRONMENT]                    # The environment to run `dbconsole` in (e.g. test / development / production).
         -p, [--include-password], [--no-include-password]  # Automatically provide the password from database.yml
      -      [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode (html, list, line, column).
      +      [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode
                                                            # Possible values: html, list, line, column
             [--header], [--no-header]
         --db, [--database=DATABASE]                        # Specifies the database to use.
    
      +Start a console for the database specified in config/database.yml
      +
       $ bin/rails server --help
       Usage:
      -  bin/rails server -u [thin/puma/webrick] [options]
      +  bin/rails server
    
       Options:
         -e, [--environment=ENVIRONMENT]              # The environment to run `server` in (e.g. test / development / production).
      @@ -26,3 +28,5 @@
         -C, [--dev-caching], [--no-dev-caching]      # Specifies whether to perform caching in development.
             [--early-hints], [--no-early-hints]      # Enables HTTP/2 early hints.
             [--log-to-stdout], [--no-log-to-stdout]  # Whether to log to stdout. Enabled by default in development when not daemonized.
      +
      +Start the Rails server
      ```
    91a5b084
    Integrate various commands with Thor's help system
    Jonathan Hefner authored
    This modifies a handful of commands to better integrate with Thor's help
    system.
    
    __Before (examples)__
    
      ```console
      $ bin/rails dbconsole --help
      Usage:
        bin/rails dbconsole
    
      Options:
        -e, [--environment=ENVIRONMENT]                    # The environment to run `dbconsole` in (e.g. test / development / production).
        -p, [--include-password], [--no-include-password]  # Automatically provide the password from database.yml
            [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode (html, list, line, column).
                                                           # Possible values: html, list, line, column
            [--header], [--no-header]
        --db, [--database=DATABASE]                        # Specifies the database to use.
    
      $ bin/rails server --help
      Usage:
        bin/rails server -u [thin/puma/webrick] [options]
    
      Options:
        -e, [--environment=ENVIRONMENT]              # The environment to run `server` in (e.g. test / development / production).
        -p, [--port=port]                            # Runs Rails on the specified port - defaults to 3000.
        -b, [--binding=IP]                           # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.
        -c, [--config=file]                          # Uses a custom rackup configuration.
                                                     # Default: config.ru
        -d, [--daemon], [--no-daemon]                # Runs server as a Daemon.
        -u, [--using=name]                           # Specifies the Rack server used to run the application (thin/puma/webrick).
        -P, [--pid=PID]                              # Specifies the PID file - defaults to tmp/pids/server.pid.
        -C, [--dev-caching], [--no-dev-caching]      # Specifies whether to perform caching in development.
            [--early-hints], [--no-early-hints]      # Enables HTTP/2 early hints.
            [--log-to-stdout], [--no-log-to-stdout]  # Whether to log to stdout. Enabled by default in development when not daemonized.
      ```
    
    __After (examples)__
    
      ```console
      $ bin/rails dbconsole --help
      Usage:
        bin/rails dbconsole
    
      Options:
        -e, [--environment=ENVIRONMENT]                    # The environment to run `dbconsole` in (e.g. test / development / production).
        -p, [--include-password], [--no-include-password]  # Automatically provide the password from database.yml
            [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode
                                                           # Possible values: html, list, line, column
            [--header], [--no-header]
        --db, [--database=DATABASE]                        # Specifies the database to use.
    
      Start a console for the database specified in config/database.yml
    
      $ bin/rails server --help
      Usage:
        bin/rails server
    
      Options:
        -e, [--environment=ENVIRONMENT]              # The environment to run `server` in (e.g. test / development / production).
        -p, [--port=port]                            # Runs Rails on the specified port - defaults to 3000.
        -b, [--binding=IP]                           # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.
        -c, [--config=file]                          # Uses a custom rackup configuration.
                                                     # Default: config.ru
        -d, [--daemon], [--no-daemon]                # Runs server as a Daemon.
        -u, [--using=name]                           # Specifies the Rack server used to run the application (thin/puma/webrick).
        -P, [--pid=PID]                              # Specifies the PID file - defaults to tmp/pids/server.pid.
        -C, [--dev-caching], [--no-dev-caching]      # Specifies whether to perform caching in development.
            [--early-hints], [--no-early-hints]      # Enables HTTP/2 early hints.
            [--log-to-stdout], [--no-log-to-stdout]  # Whether to log to stdout. Enabled by default in development when not daemonized.
    
      Start the Rails server
      ```
    
    __Diff__
    
      ```diff
      @@ -5,14 +5,16 @@
       Options:
         -e, [--environment=ENVIRONMENT]                    # The environment to run `dbconsole` in (e.g. test / development / production).
         -p, [--include-password], [--no-include-password]  # Automatically provide the password from database.yml
      -      [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode (html, list, line, column).
      +      [--mode=MODE]                                  # Automatically put the sqlite3 database in the specified mode
                                                            # Possible values: html, list, line, column
             [--header], [--no-header]
         --db, [--database=DATABASE]                        # Specifies the database to use.
    
      +Start a console for the database specified in config/database.yml
      +
       $ bin/rails server --help
       Usage:
      -  bin/rails server -u [thin/puma/webrick] [options]
      +  bin/rails server
    
       Options:
         -e, [--environment=ENVIRONMENT]              # The environment to run `server` in (e.g. test / development / production).
      @@ -26,3 +28,5 @@
         -C, [--dev-caching], [--no-dev-caching]      # Specifies whether to perform caching in development.
             [--early-hints], [--no-early-hints]      # Enables HTTP/2 early hints.
             [--log-to-stdout], [--no-log-to-stdout]  # Whether to log to stdout. Enabled by default in development when not daemonized.
      +
      +Start the Rails server
      ```
Loading