Skip to content

single-dash options are not handled correctly #1373

Open
@kolbe

Description

@kolbe

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

TiUP fails to pass multi-character ("long") options with a single-dash prefix to subcomponents.

  1. What did you expect to see?

  2. 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)
...
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/tiupIssues about the TiUP package management component itselftype/bugCategorizes issue as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions