Skip to content

Commit

Permalink
feat: Ensure that old flags continue working
Browse files Browse the repository at this point in the history
  • Loading branch information
donovanglover committed Oct 30, 2023
1 parent 6d0f4ea commit 0a2a6e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ pub struct Cli {
#[arg(short, long, default_value_t = false)]
pub no_empty: bool,

/// Don't create empty workspaces to the left
///
/// NOTE: This flag is deprecated and has been replaced with --no-empty. The flag is
/// kept for backwards compatibility with v0.1.0, but is hidden by default.
#[arg(long, default_value_t = false, hide = true)]
pub no_empty_before: bool,

/// Don't create empty workspaces to the right
///
/// NOTE: This flag is deprecated and has been replaced with --no-empty. The flag is
/// kept for backwards compatibility with v0.1.0, but is hidden by default.
#[arg(short = 'N', long, default_value_t = false, hide = true)]
pub no_empty_after: bool,

/// Don't auto-close special workspaces when switching workspaces
///
/// With --move:
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,17 @@ pub fn get_id() -> i32 {
let Cli {
previous,
no_empty,
no_empty_before,
no_empty_after,
..
} = Cli::parse();

state.log();

if previous {
get_previous_id(state, no_empty)
get_previous_id(state, no_empty || no_empty_before)
} else {
get_next_id(state, no_empty)
get_next_id(state, no_empty || no_empty_after)
}
}

Expand Down

0 comments on commit 0a2a6e1

Please sign in to comment.