cli.rs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2019 Joystream Contributors
  2. // This file is part of Joystream node.
  3. // Joystream node is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation, either version 3 of the License, or
  6. // (at your option) any later version.
  7. // Joystream node is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU General Public License for more details.
  11. // You should have received a copy of the GNU General Public License
  12. // along with Joystream node. If not, see <http://www.gnu.org/licenses/>.
  13. use sc_cli::RunCmd;
  14. use structopt::StructOpt;
  15. /// An overarching CLI command definition.
  16. #[derive(Debug, StructOpt)]
  17. pub struct Cli {
  18. /// Possible subcommand with parameters.
  19. #[structopt(subcommand)]
  20. pub subcommand: Option<Subcommand>,
  21. #[allow(missing_docs)]
  22. #[structopt(flatten)]
  23. pub run: RunCmd,
  24. }
  25. /// Possible subcommands of the main binary.
  26. #[derive(Debug, StructOpt)]
  27. pub enum Subcommand {
  28. /// A set of base subcommands handled by `sc_cli`.
  29. #[structopt(flatten)]
  30. Base(sc_cli::Subcommand),
  31. /// The custom inspect subcommmand for decoding blocks and extrinsics.
  32. #[structopt(
  33. name = "inspect",
  34. about = "Decode given block or extrinsic using current native runtime."
  35. )]
  36. Inspect(node_inspect::cli::InspectCmd),
  37. /// The custom benchmark subcommmand benchmarking runtime pallets.
  38. #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
  39. Benchmark(frame_benchmarking_cli::BenchmarkCmd),
  40. }