• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef HIPERF_SUBCOMMAND_HELP_H_
16 #define HIPERF_SUBCOMMAND_HELP_H_
17 
18 #include "option.h"
19 #include "subcommand.h"
20 namespace OHOS {
21 namespace Developtools {
22 namespace HiPerf {
23 class SubCommandHelp : public SubCommand {
24 public:
SubCommandHelp()25     SubCommandHelp()
26         // clang-format off
27         : SubCommand("help", "Show more help information for hiperf",
28         "Usage: hiperf help [subcommand]\n"
29         "    By default, all options help information and subcommand brief information are output.\n"
30         "    If you provide a subcommand, only the help information for this command will be output.\n\n"
31         )
32     // clang-format on
33     {
34         Option::RegisterMainOption("--help", "show help", OnHelp);
35         Option::RegisterMainOption("-h", "show help", OnHelp);
36     }
37 
38     bool OnSubCommand(std::vector<std::string> &args) override;
39     static void RegisterSubCommandHelp(void);
40     static bool OnHelp(std::vector<std::string> &args);
41 };
42 } // namespace HiPerf
43 } // namespace Developtools
44 } // namespace OHOS
45 #endif