djezzzl / database_consistency

The tool to avoid various issues due to inconsistencies and inefficiencies between a database schema and application models.
MIT License
1.05k stars 46 forks source link

Misleading commandline help message #162

Closed la-magra closed 1 year ago

la-magra commented 1 year ago
$ bundle exec database_consistency -h
  Usage: database_consistency install - run installation
         database_consistency [options]
    -c, --config=FILE                Use additional configuration file.
    -g, --generate-todo              Generate TODO file with every failing check disabled. You can pass existing configurations so the generated file will have only new failures.
    -f, --autofixix                  Automatically fixes issues by adjusting the code or generating missing migrations.
    -h, --help                       Prints this help.
$ bundle exec database_consistency -f
bundler: failed to load command: database_consistency (/home/***/.gem/ruby/3.1.3/bin/database_consistency)
/home/***/.gem/ruby/3.1.3/gems/database_consistency-1.5.1/bin/database_consistency:52:in `<top (required)>': missing argument: -f (OptionParser::MissingArgument)
...
$ bundle exec database_consistency --autofixix
bundler: failed to load command: database_consistency (/home/***/.gem/ruby/3.1.3/bin/database_consistency)
/home/***/.gem/ruby/3.1.3/gems/database_consistency-1.5.1/bin/database_consistency:52:in `<top (required)>': invalid option: --autofixix (OptionParser::InvalidOption)
Did you mean?  autofix
...

probably due to https://github.com/djezzzl/database_consistency/blob/17725a58f931ff80d6c801cd50e505177cf463d2/bin/database_consistency#L42 first parameter having two extra characters.

djezzzl commented 1 year ago

Hi @la-magra,

Thank you for using the gem and reporting the issue! Here is the fix: https://github.com/djezzzl/database_consistency/pull/165

It will be released by the end of today.

djezzzl commented 1 year ago

Released in 1.5.2. Thank you again! Have a great day!

la-magra commented 1 year ago

Thank you, I wish you the same.