Tiup -B error? --binary works fine, is it a bug?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiup -B 报错?–binary没问题,bug吗?

| username: 我是咖啡哥

Check the documentation TiUP 命令概览 | PingCAP 文档中心

-B, --binary

Print the binary file path of the specified component:

  • Executing tiup -B/--binary <component> will print the path of the latest stable version of the installed <component> component. If the <component> component is not installed, an error will be reported.
  • Executing tiup -B/--binary <component>:<version> will print the path of the installed <component> component’s <version> version. If that version is not installed, an error will be reported.

I did an experiment, and it actually reported an error…

~$ tiup --version
1.11.0 tiup
Go Version: go1.19
Git Ref: v1.11.0
GitHash: 1a4714d7146fa85240a1ff4ef7451df719e0b4f0

~$ tiup --binary tiflash:v6.0.0
/Users/hqh/.tiup/components/tiflash/v6.0.0/tiflash/tiflash
~$ tiup --binary tidb:v6.0.0
/Users/hqh/.tiup/components/tidb/v6.0.0/tidb-server

~$ tiup -B tidb:v6.0.0
tiup is checking updates for component -B ...timeout!
The component `-B` version  is not installed; downloading from repository.
The component `-B` not found (may be deleted from repository); skipped
| username: Jiawei | Original post link

If this version is not installed, an error will be reported.
tidb:v6.0.0 Is this version not installed?

| username: onlyacat | Original post link

There is a bug in tiup where the uppercase parameter ‘B’ is not set during command parsing.

If anyone has time, please submit a PR.


| username: 我是咖啡哥 | Original post link

Wow, you even dug out the source code. :100:

| username: 我是咖啡哥 | Original post link

Found the source code.
Line 211:

| username: Billmay表妹 | Original post link

The issue has been reported. If you know how to submit a PR, you can go ahead and submit one. If you don’t know how, just wait for the engineers to submit it.

| username: 我是咖啡哥 | Original post link

My GitHub is very slow and often fails to load, so I can’t submit anything.

| username: Billmay表妹 | Original post link

This is a bug in the documentation.

A PR has been submitted to fix it: see the specific progress at:

remove arg -B in tiup by Oreoxmt · Pull Request #11362 · pingcap/docs

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.