xenomachina / kotlin-argparser

Easy to use and concise yet powerful and robust command line argument parsing for Kotlin
GNU Lesser General Public License v2.1
485 stars 33 forks source link

Added --version option in the same manner as --help. #70

Open pcoltau opened 5 years ago

pcoltau commented 5 years ago

I've added a --version option in the same manner as the --help option.

The version can be provided in the ArgParser constructor if needed. If it is not provided, no --version option will be added. This makes the change fully compatible with older versions of the ArgParser.

I've also added a -v option for the version, but I'm unsure if this is wanted. Let me know, and I can remove it.

codecov-io commented 5 years ago

Codecov Report

Merging #70 into master will increase coverage by 0.31%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #70      +/-   ##
============================================
+ Coverage      84.9%   85.21%   +0.31%     
- Complexity      138      139       +1     
============================================
  Files            11       11              
  Lines           424      433       +9     
  Branches         84       85       +1     
============================================
+ Hits            360      369       +9     
  Misses           27       27              
  Partials         37       37
Impacted Files Coverage Δ Complexity Δ
...main/kotlin/com/xenomachina/argparser/ArgParser.kt 91.12% <100%> (+0.25%) 55 <0> (+1) :arrow_up:
...ain/kotlin/com/xenomachina/argparser/Exceptions.kt 95.65% <100%> (+0.65%) 0 <0> (ø) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 263784f...9a49bbe. Read the comment docs.

pcoltau commented 5 years ago

Any chance of getting this merged?

Malinskiy commented 5 years ago

+1 for this change