ClickHouse/dbms/programs/client
Azat Khuzhin 6d8706e692
clickhouse-client: fix --help without tty
stdin_is_not_tty is detected too late when the --help message is
printed, so fix this and do not call ioctl if stdin is not tty.

Before this patch:
  $ clickhouse-client --help < /dev/null

debug build:
  $ dbms/programs/clickhouse-client --help < /dev/null
  Main options:
    --help
  clickhouse-client: ../contrib/boost/libs/program_options/src/options_description.cpp:542:
  void boost::program_options::{anonymous}::format_description(std::ostream&, const string&, unsigned int, unsigned int): Assertion `line_length > first_column_width' failed.
  Aborted (core dumped)

release build:
  $ dbms/programs/clickhouse-client --help < /dev/null
  .... print lots of empty lines and so forth ...

v2: add a test and bsdutils into image for tests
v3: adjust minimal cols to the length of one of the longest arguments,
since with line_length=3 boost will bail anyway (under script(1)
ioctl(TIOCGWINSZ) returnes ws_col=0)
2019-03-23 02:01:32 +03:00
..
clickhouse-client.cpp Squashed #2471 2018-06-05 23:09:51 +03:00
clickhouse-client.xml Fixed bug in client (double whitespace) [#CLICKHOUSE-4038] 2018-09-29 22:33:23 +03:00
Client.cpp clickhouse-client: fix --help without tty 2019-03-23 02:01:32 +03:00
CMakeLists.txt Fix link in split mode (#4574) 2019-03-04 20:47:31 +03:00
ConnectionParameters.h Merge remote-tracking branch 'upstream/master' into CLICKHOUSE-3729 2019-02-04 20:13:50 +03:00
Suggest.h Added one more keyword for command line completions #4328 2019-02-10 23:30:28 +03:00
TestHint.h Addition to prev. revision #4103 2019-01-21 19:14:26 +03:00