Skip to content

Commit

Permalink
refactor: remove MODE_OPTIONS which wasn't used in a well-defined way
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyscot committed Jan 9, 2025
1 parent ae835bc commit 390ee6f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
3 changes: 0 additions & 3 deletions src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ use clap::{ArgAction::SetTrue, Args as _, FromArgMatches as _, Parser};

use crate::{config::Manager, util::AddressFamily};

/// Options that switch us into another mode i.e. which don't require source/destination arguments
pub(crate) const MODE_OPTIONS: &[&str] = &["server", "help_buffers", "config_files", "show_config"];

/// CLI argument definition
#[derive(Debug, Parser, Clone)]
#[command(
Expand Down
1 change: 0 additions & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
mod args;
mod cli_main;
pub mod styles;
pub(crate) use args::MODE_OPTIONS;
pub use cli_main::cli;
10 changes: 2 additions & 8 deletions src/client/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,13 @@ pub struct Parameters {
// JOB SPECIFICAION ====================================================================
// (POSITIONAL ARGUMENTS!)
/// The source file. This may be a local filename, or remote specified as HOST:FILE or USER@HOST:FILE.
#[arg(
required_unless_present_any(crate::cli::MODE_OPTIONS),
value_name = "SOURCE"
)]
#[arg(value_name = "SOURCE")]
pub source: Option<FileSpec>,

/// Destination. This may be a file or directory. It may be local or remote.
///
/// If remote, specify as HOST:DESTINATION or USER@HOST:DESTINATION; or simply HOST: or USER@HOST: to copy to your home directory there.
#[arg(
required_unless_present_any(crate::cli::MODE_OPTIONS),
value_name = "DESTINATION"
)]
#[arg(value_name = "DESTINATION")]
pub destination: Option<FileSpec>,
}

Expand Down

0 comments on commit 390ee6f

Please sign in to comment.