terminal-in-react icon indicating copy to clipboard operation
terminal-in-react copied to clipboard

fix `command -h` problems

Open dusmart opened this issue 4 years ago • 1 comments

You can reproduce the problems by using help -h twice.

The problems when using command -h are

  1. duplicate help message after using -h
  2. cannot read default value of the option properly after using -h

This PR fix them by

  1. prevent adding options that have the same name as existing ones
  2. prevent modifying option.usage from Object to string

dusmart avatar Jun 17 '21 06:06 dusmart

http://terminal-in-react.surge.sh/

color white color -h color -h color -c red

image

dusmart avatar Jun 17 '21 06:06 dusmart