single-dash options are not handled correctly
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 466
- Forks
- 338
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 8
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
- What did you do?
TiUP fails to pass multi-character ("long") options with a single-dash prefix to subcomponents.
-
What did you expect to see?
-
What did you see instead?
It seems that somehow whatever tiup is doing to proxy the options to the subcommand results in them being mishandled?
It seems that when the option has a single-dash prefix and contains an "h", it's interpreted as "-h" (help/usage output) when sent through tiup but not when the tool is invoked directly!
ubuntu@ip-10-0-1-86:~$ tiup --help tidb-lightning -backend tidb -tidb-host 127.0.0.1
use `tiup install --help` to install component `--help` first: component not installed
ubuntu@ip-10-0-1-86:~$ ~/.tiup/components/tidb-lightning/v5.0.1/tidb-lightning -tidb-host 127.0.0.1
Verbose debug logs will be written to /tmp/lightning.log.2021-05-19T22.47.34Z
tidb lightning encountered error: cannot fetch settings from TiDB, please manually fill in `tidb.port` and `tidb.pd-addr`: Get http://127.0.0.1:10080/settings: dial tcp 127.0.0.1:10080: connect: connection refused
ubuntu@ip-10-0-1-86:~$ tiup tidb-lightning -tidb-host 127.0.0.1
Usage:
-L value
log level: info, debug, warn, error, fatal (default info)
-V print version of lightning
-analyze value
analyze table after importing
-backend value
delivery backend: importer, tidb, local (default importer)
...
- What version of TiUP are you using (
tiup --version)?
1.4.3 tiup
Go Version: go1.16.4
Git Ref: v1.4.3
GitHash: 0faec47a553138b68c4e1529a771746cc2e17011
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown TiUP 1.4.3 commands, comparing tiup tidb-lightning -tidb-host 127.0.0.1 with the direct tidb-lightning invocation. Trace how TiUP proxies component arguments, especially single-dash multi-character options containing h. Done means these options reach the subcomponent unchanged instead of producing TiUP or help output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100