sui_graphql_rpc/
commands.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use clap::*;
5use std::path::PathBuf;
6
7use crate::config::{ConnectionConfig, Ide, TxExecFullNodeConfig};
8
9#[derive(Parser)]
10#[clap(
11    name = "sui-graphql-rpc",
12    about = "Sui GraphQL RPC",
13    rename_all = "kebab-case",
14    author,
15    version
16)]
17pub enum Command {
18    /// Output a TOML config (suitable for passing into the --config parameter of the start-server
19    /// command) with all values set to their defaults.
20    GenerateConfig {
21        /// Optional path to an output file. Prints to `stdout` if not provided.
22        output: Option<PathBuf>,
23    },
24
25    StartServer {
26        #[clap(flatten)]
27        ide: Ide,
28
29        #[clap(flatten)]
30        connection: ConnectionConfig,
31
32        /// Path to TOML file containing configuration for service.
33        #[clap(short, long)]
34        config: Option<PathBuf>,
35
36        #[clap(flatten)]
37        tx_exec_full_node: TxExecFullNodeConfig,
38    },
39}