nitin42 / terminal-in-react

👨‍💻 A component that renders a terminal
http://terminal-in-react.surge.sh/
MIT License
2.13k stars 151 forks source link

fix `command -h` problems #103

Closed dusmart closed 1 year ago

dusmart commented 3 years ago

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 commented 3 years ago

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

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

image