Skip to content

Commit

Permalink
Add better help on what tracing destinations exist
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin authored and andy31415 committed Jun 13, 2023
1 parent 2c229fd commit a2690dc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/chip-tool/commands/common/CHIPCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "Command.h"

#include <TracingCommandLinArgument.h>
#include <commands/common/CredentialIssuerCommands.h>
#include <commands/example/ExampleCredentialIssuerCommands.h>
#include <credentials/GroupDataProviderImpl.h>
Expand Down Expand Up @@ -85,7 +86,7 @@ class CHIPCommand : public Command
AddArgument("trace_log", 0, 1, &mTraceLog);
AddArgument("trace_decode", 0, 1, &mTraceDecode);
#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
AddArgument("trace-to", &mTraceTo, "Trace destinations, comma-separated (e.g. log)");
AddArgument("trace-to", &mTraceTo, "Trace destinations, comma-separated (" SUPPORTED_COMMAND_LINE_TRACING_TARGETS ")");
AddArgument("ble-adapter", 0, UINT16_MAX, &mBleAdapterId);
AddArgument("storage-directory", &mStorageDirectory,
"Directory to place chip-tool's storage files in. Defaults to $TMPDIR, with fallback to /tmp");
Expand Down
5 changes: 5 additions & 0 deletions examples/common/tracing/TracingCommandLineArgument.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
*/
#pragma once

/// A string with supported command line tracing targets
/// to be pretty-printed in help strings if needed
#define SUPPORTED_COMMAND_LINE_TRACING_TARGETS "log"

namespace chip {
namespace CommandLineApp {


/// Enable tracing based on the given command line argument
/// like "log" or "log,perfetto" or similar
///
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal-mdns/advertiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS"
" Operational node id.\n"
" -t <dest>\n"
" --trace-to <dest>\n"
" trace to the given destination.\n"
" trace to the given destination (supported: " SUPPORTED_COMMAND_LINE_TRACING_TARGETS ").\n"
"\n" };

HelpOptions helpOptions("advertiser", "Usage: advertiser [options]", "1.0");
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal-mdns/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS"
" --multicast-reply\n"
" Do not request unicast replies\n"
" --trace-to <dest>\n"
" trace to the given destination.\n"
" trace to the given destination (supported: " SUPPORTED_COMMAND_LINE_TRACING_TARGETS ").\n"
"\n" };

HelpOptions helpOptions("minimal-mdns-client", "Usage: minimal-mdns-client [options]", "1.0");
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal-mdns/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS"
" instance name to advertise.\n"
" -t <dest>\n"
" --trace-to <dest>\n"
" trace to the given destination.\n"
" trace to the given destination (supported: " SUPPORTED_COMMAND_LINE_TRACING_TARGETS ").\n"
"\n" };

HelpOptions helpOptions("minimal-mdns-server", "Usage: minimal-mdns-server [options]", "1.0");
Expand Down
2 changes: 1 addition & 1 deletion src/lib/address_resolve/tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const char * const sHelp =
"Usage: address-resolve-tool [<options...>] <command> [ <args...> ]\n"
"\n"
"Options:\n"
" --trace-to <dest> -- Trace to the given destination\n"
" --trace-to <dest> -- Trace to the given destination (" SUPPORTED_COMMAND_LINE_TRACING_TARGETS ")\n"
"Commands:\n"
"\n"
" node <nodeid> <compressed_fabricid> -- Find the node for the given node/fabric.\n"
Expand Down

0 comments on commit a2690dc

Please sign in to comment.