mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
Merge pull request #14057 from azat/clickhouse-copier-cmd-args-width
Use terminal width for the formatted help text of the clickhouse-copier
This commit is contained in:
commit
2c45c27e0e
@ -1,5 +1,7 @@
|
|||||||
#include "ClusterCopierApp.h"
|
#include "ClusterCopierApp.h"
|
||||||
#include <Common/StatusFile.h>
|
#include <Common/StatusFile.h>
|
||||||
|
#include <Common/TerminalSize.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
@ -52,7 +54,13 @@ void ClusterCopierApp::initialize(Poco::Util::Application & self)
|
|||||||
|
|
||||||
void ClusterCopierApp::handleHelp(const std::string &, const std::string &)
|
void ClusterCopierApp::handleHelp(const std::string &, const std::string &)
|
||||||
{
|
{
|
||||||
|
uint16_t terminal_width = 0;
|
||||||
|
if (isatty(STDIN_FILENO))
|
||||||
|
terminal_width = getTerminalWidth();
|
||||||
|
|
||||||
Poco::Util::HelpFormatter help_formatter(options());
|
Poco::Util::HelpFormatter help_formatter(options());
|
||||||
|
if (terminal_width)
|
||||||
|
help_formatter.setWidth(terminal_width);
|
||||||
help_formatter.setCommand(commandName());
|
help_formatter.setCommand(commandName());
|
||||||
help_formatter.setHeader("Copies tables from one cluster to another");
|
help_formatter.setHeader("Copies tables from one cluster to another");
|
||||||
help_formatter.setUsage("--config-file <config-file> --task-path <task-path>");
|
help_formatter.setUsage("--config-file <config-file> --task-path <task-path>");
|
||||||
|
Loading…
Reference in New Issue
Block a user