Skip to content

Rails new command help weird groupings #47258

@zzak

Description

@zzak

I noticed when running rails new --help that some of the groups were off to me.

  -T, [--skip-test], [--no-skip-test]                            # Skip test files
          [--skip-system-test], [--no-skip-system-test]          # Skip system test files
          [--skip-bootsnap], [--no-skip-bootsnap]                # Skip bootsnap gem
          [--skip-dev-gems], [--no-skip-dev-gems]                # Skip development gems (e.g., web-console)
          [--dev], [--no-dev]                                    # Set up the application with Gemfile pointing to your Rails checkout
          [--edge], [--no-edge]                                  # Set up the application with a Gemfile pointing to the main branch on the Rails repository

It seems weird that --dev and --edge are under the skip tests group, for example.

--master, [--main], [--no-main]                                # Set up the application with Gemfile pointing to Rails repository main branch
          [--rc=RC]                                              # Path to file containing extra configuration options for rails command
          [--no-rc], [--no-no-rc]                                # Skip loading of extra configuration options from .railsrc file
          [--api], [--no-api]                                    # Preconfigure smaller stack for API only apps
          [--minimal], [--no-minimal]                            # Preconfigure a minimal rails app

It looks like --api is an option under the --master group, which they are not mutually exclusive afaik.

  -B, [--skip-bundle], [--no-skip-bundle]                        # Don't run bundle install
          [--skip-decrypted-diffs], [--no-skip-decrypted-diffs]  # Don't configure git to show decrypted diffs of encrypted credentials

In this case, it looks like -B can also be used for --skip-decrypted-diffs.

I think the absence of a comma after [--no-skip-bundle] means it is not a continuation, but due to the indentation, my brain thinks they are related.

Here's another example:

  -G, [--skip-git], [--no-skip-git]                              # Skip git init, .gitignore and .gitattributes
          [--skip-docker], [--no-skip-docker]                    # Skip Dockerfile, .dockerignore and bin/docker-entrypoint
          [--skip-keeps], [--no-skip-keeps]                      # Skip source control .keep files
  -M, [--skip-action-mailer], [--no-skip-action-mailer]          # Skip Action Mailer files
          [--skip-action-mailbox], [--no-skip-action-mailbox]    # Skip Action Mailbox gem
          [--skip-action-text], [--no-skip-action-text]          # Skip Action Text gem
  -O, [--skip-active-record], [--no-skip-active-record]          # Skip Active Record files
          [--skip-active-job], [--no-skip-active-job]            # Skip Active Job
          [--skip-active-storage], [--no-skip-active-storage]    # Skip Active Storage files

It looks like the flags after the initial -G, [--skip-git], [--no-skip-git] are "grouped" based on the indentation.

I've no idea how to fix this yet, but thought it was worth an issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions