Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/traffic_ctl/traffic_ctl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,15 @@ main([[maybe_unused]] int argc, const char **argv)
// server commands
server_command.add_command("backtrace", "Show a full stack trace of the traffic_server process",
[&]() { CtrlUnimplementedCommand("backtrace"); });
server_command.add_command("status", "Show the proxy status", Command_Execute).add_example_usage("traffic_ctl server status");
server_command.add_command("drain", "Drain the requests", Command_Execute)
.add_example_usage("traffic_ctl server drain [OPTIONS]")
.add_option("--no-new-connection", "-N", "Wait for new connections down to threshold before starting draining")
.add_option("--undo", "-U", "Recover server from the drain mode");
server_command.add_command("status", "Show the proxy status", [&]() { command->execute(); })
.add_example_usage("traffic_ctl server status");
auto &drain_cmd = server_command.add_command("drain", "Drain the requests", [&]() { command->execute(); });
drain_cmd.add_example_usage("traffic_ctl server drain [OPTIONS]");

drain_cmd.add_mutex_group("drain_mode", false, "Drain mode options");
drain_cmd.add_option_to_group("drain_mode", "--no-new-connection", "-N",
"Wait for new connections down to threshold before starting draining");
drain_cmd.add_option_to_group("drain_mode", "--undo", "-U", "Recover server from the drain mode");

auto &debug_command =
server_command.add_command("debug", "Enable/Disable ATS for diagnostic messages at runtime").require_commands();
Expand Down
11 changes: 6 additions & 5 deletions src/traffic_layout/traffic_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ main([[maybe_unused]] int argc, const char **argv)
.add_option("--version", "-V", "Print version string");

// info command
engine.parser.add_command("info", "Show the layout as default", [&]() { engine.info(); })
.add_option("--features", "", "Show the compiled features")
.add_option("--versions", "", "Show various library and other versioning information")
.add_option("--json", "-j", "Produce output in JSON format (when supported)")
.set_default();
auto &info_cmd = engine.parser.add_command("info", "Show the layout as default", [&]() { engine.info(); });
info_cmd.add_mutex_group("display_mode", false, "Display mode options");
info_cmd.add_option_to_group("display_mode", "--features", "", "Show the compiled features");
info_cmd.add_option_to_group("display_mode", "--versions", "", "Show various library and other versioning information");

info_cmd.add_option("--json", "-j", "Produce output in JSON format (when supported)").set_default();
// init command
engine.parser.add_command("init", "Initialize(create) the runroot sandbox", [&]() { engine.create_runroot(); })
.add_option("--absolute", "-a", "Produce absolute path in the runroot.yaml")
Expand Down