main.rs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* This file is part of DarkFi (https://dark.fi)
  2. *
  3. * Copyright (C) 2020-2023 Dyne.org foundation
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Affero General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Affero General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. use clap::{Parser, Subcommand};
  19. #[derive(Subcommand)]
  20. pub enum CliSubCommands {
  21. /// Create a random Base value
  22. Random {},
  23. /// Convert int to Base
  24. FromInt {
  25. value: u64,
  26. },
  27. Add {
  28. value_a: String,
  29. value_b: String,
  30. },
  31. Sub {
  32. value_a: String,
  33. value_b: String,
  34. },
  35. Mul {
  36. value_a: String,
  37. value_b: String,
  38. },
  39. MakeProof {
  40. bincode: String,
  41. witness: String,
  42. publics: String,
  43. },
  44. VerifyProof {
  45. bincode: String,
  46. publics: String,
  47. },
  48. }
  49. #[derive(Parser)]
  50. #[clap(name = "zktool")]
  51. #[clap(arg_required_else_help(true))]
  52. pub struct CliDao {
  53. /// Increase verbosity
  54. #[clap(short, action = clap::ArgAction::Count)]
  55. pub verbose: u8,
  56. #[clap(subcommand)]
  57. pub command: Option<CliSubCommands>,
  58. }
  59. fn main() {
  60. let args = CliDao::parse();
  61. match args.command {
  62. Some(_) => {
  63. println!("Some arg!");
  64. }
  65. None => todo!(),
  66. }
  67. }