MCPcopy Create free account
hub / github.com/PDAL/PDAL / outputHelp

Method outputHelp

pdal/SubcommandKernel.cpp:82–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81
82void SubcommandKernel::outputHelp()
83{
84 auto outputStdOpts = [this]()
85 {
86 ProgramArgs args;
87 addBasicSwitches(args);
88
89 std::cout << "standard options:" << std::endl;
90 args.dump(std::cout, 2, Utils::screenWidth());
91 };
92
93 auto outputSubOpts = [this](const std::string& sub)
94 {
95 ProgramArgs args;
96 addSubSwitches(args, sub);
97
98 std::cout << "subcommand '" << sub << "' options:" << std::endl;
99 args.dump(std::cout, 2, Utils::screenWidth());
100 };
101
102 if (Utils::contains(subcommands(), m_subcommand))
103 {
104 // We're repeating addSubSwitches here (it's also called from
105 // outputSubOpts), but it keeps things cleaner since outputSubOpts
106 // also writes output.
107 ProgramArgs args;
108 addSubSwitches(args, m_subcommand);
109
110 std::cout << "usage: " << "pdal " << getShortName() << " " <<
111 m_subcommand << " [options] " << args.commandLine() <<
112 std::endl;
113
114 outputStdOpts();
115 outputSubOpts(m_subcommand);
116 }
117 else
118 {
119 std::cout << "usage: " << "pdal " << getShortName() <<
120 " <subcommand> [options] " << std::endl;
121
122 outputStdOpts();
123 for (const std::string& subcmd : subcommands())
124 outputSubOpts(subcmd);
125 }
126
127 std::cout << "\nFor more information, see the full documentation for "
128 "PDAL at https://pdal.org/\n" << std::endl;
129}
130
131} // namespace pdal
132

Callers

nothing calls this directly

Calls 5

addSubSwitchesFunction · 0.85
getShortNameFunction · 0.85
containsFunction · 0.50
dumpMethod · 0.45
commandLineMethod · 0.45

Tested by

no test coverage detected