Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nacardin committed Nov 1, 2023
1 parent 040330d commit 1e81781
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions crates/fluvio-sc/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ pub struct ScOpt {
#[derive(Debug, Args)]
#[group(required = true, multiple = false)]
pub struct ScOptRunMode {
/// run in local mode
#[arg(long, value_name = "metadata path")]
local: Option<PathBuf>,
/// run on k8
#[arg(long)]
k8: bool,

/// run SC in read only mode
#[arg(long, hide = true)]
read_only: Option<PathBuf>,
/// run in local mode
#[arg(long, value_name = "metadata path")]
local: Option<PathBuf>,

/// run on k8
#[arg(long)]
k8: bool,

/// run SC in read only mode
#[arg(long, hide = true)]
read_only: Option<PathBuf>,
}

#[derive(Debug)]
Expand All @@ -96,7 +96,11 @@ pub enum RunMode<'a> {

impl ScOpt {
pub fn mode(&self) -> RunMode<'_> {
match (&self.run_mode.local, &self.run_mode.read_only, self.run_mode.k8) {
match (
&self.run_mode.local,
&self.run_mode.read_only,
self.run_mode.k8,
) {
(Some(metadata), None, false) => RunMode::Local(metadata),
(None, Some(path), false) => RunMode::ReadOnly(path),
(None, None, true) => RunMode::K8s,
Expand Down

0 comments on commit 1e81781

Please sign in to comment.