1189251Ssam// Copyright 2010 Google Inc. 2189251Ssam// All rights reserved. 3189251Ssam// 4189251Ssam// Redistribution and use in source and binary forms, with or without 5189251Ssam// modification, are permitted provided that the following conditions are 6189251Ssam// met: 7189251Ssam// 8189251Ssam// * Redistributions of source code must retain the above copyright 9189251Ssam// notice, this list of conditions and the following disclaimer. 10189251Ssam// * Redistributions in binary form must reproduce the above copyright 11189251Ssam// notice, this list of conditions and the following disclaimer in the 12189251Ssam// documentation and/or other materials provided with the distribution. 13189251Ssam// * Neither the name of Google Inc. nor the names of its contributors 14189251Ssam// may be used to endorse or promote products derived from this software 15189251Ssam// without specific prior written permission. 16189251Ssam// 17189251Ssam// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18189251Ssam// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19189251Ssam// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20189251Ssam// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21189251Ssam// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22189251Ssam// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23189251Ssam// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24189251Ssam// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25189251Ssam// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26189251Ssam// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27189251Ssam// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28189251Ssam 29189251Ssam/// \file cli/cmd_help.hpp 30189251Ssam/// Provides the cmd_help class. 31189251Ssam 32189251Ssam#if !defined(CLI_CMD_HELP_HPP) 33189251Ssam#define CLI_CMD_HELP_HPP 34189251Ssam 35189251Ssam#include "cli/common.hpp" 36189251Ssam#include "utils/cmdline/commands_map.hpp" 37189251Ssam 38189251Ssamnamespace cli { 39189251Ssam 40189251Ssam 41189251Ssam/// Implementation of the "help" subcommand. 42189251Ssamclass cmd_help : public cli_command 43189251Ssam{ 44189251Ssam /// The set of program-wide options for which to provide help. 45189251Ssam const utils::cmdline::options_vector* _options; 46189251Ssam 47189251Ssam /// The set of commands for which to provide help. 48189251Ssam const utils::cmdline::commands_map< cli_command >* _commands; 49189251Ssam 50189251Ssampublic: 51189251Ssam cmd_help(const utils::cmdline::options_vector*, 52189251Ssam const utils::cmdline::commands_map< cli_command >*); 53189251Ssam 54189251Ssam int run(utils::cmdline::ui*, const utils::cmdline::parsed_cmdline&, 55189251Ssam const utils::config::tree&); 56189251Ssam}; 57189251Ssam 58189251Ssam 59189251Ssam} // namespace cli 60189251Ssam 61189251Ssam 62189251Ssam#endif // !defined(CLI_CMD_HELP_HPP) 63189251Ssam