mattbrictson / bundle_update_interactive

A stylish interactive mode for Bundler, inspired by `yarn upgrade-interactive`
MIT License
137 stars 3 forks source link

Improve `--help` output #25

Closed mattbrictson closed 1 month ago

mattbrictson commented 1 month ago

The --help output right now is pretty bare bones:

$ bundle update-interactive --help
Usage: bundle update-interactive
        --exclusively=GROUP          Update gems that exclusively belong to the specified Gemfile GROUP(s) (comma-separated)
    -D                               Update development and test gems only; short for --exclusively=development,test
    -v, --version                    Display bundle_update_interactive version
    -h, --help                       Show this help

It would be great to show a description and some examples, ideally with some pretty ANSI colors.

For comparison, Bundler's own help output uses man-page format, which is nice, if a bit overkill:

$ bundle update --help
BUNDLE-UPDATE(1)                               General Commands Manual                              BUNDLE-UPDATE(1)

NAME
       bundle-update - Update your gems to the latest available versions

SYNOPSIS
       bundle update *gems [--all] [--group=NAME] [--source=NAME] [--local] [--ruby] [--bundler[=VERSION]]
       [--full-index] [--jobs=JOBS] [--quiet] [--patch|--minor|--major] [--redownload] [--strict] [--conservative]

DESCRIPTION
       Update the gems specified (all gems, if --all flag is used), ignoring the previously installed gems specified
       in the Gemfile.lock. In general, you should use bundle install(1) bundle-install.1.html to install the same
       exact gems and versions across machines.

       You would use bundle update to explicitly update the version of a gem.

OPTIONS
       --all  Update all gems specified in Gemfile.
...

I'm a fan of heroku's help output:

$ heroku config:set --help
set one or more config vars

USAGE
  $ heroku config:set -a <value> [-r <value>]

FLAGS
  -a, --app=<value>     (required) app to run command against
  -r, --remote=<value>  git remote of app to use

DESCRIPTION
  set one or more config vars

EXAMPLES
  $ heroku config:set RAILS_ENV=staging
  Setting config vars and restarting example... done, v10
  RAILS_ENV: staging
  $ heroku config:set RAILS_ENV=staging RACK_ENV=staging
  Setting config vars and restarting example... done, v11
  RAILS_ENV: staging
  RACK_ENV:  staging