Skip to content

Commit

Permalink
Merge pull request #144 from a-kenji/rm/apply
Browse files Browse the repository at this point in the history
cli: remove `--apply` argument
  • Loading branch information
a-kenji authored Sep 3, 2024
2 parents e5c95b9 + 4378095 commit 066c55d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 1 addition & 8 deletions src/bin/flake-edit/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ pub struct CliArgs {
/// Location of the `flake.nix` file, that will be used.
#[arg(long)]
flake: Option<String>,
/// Print a diff of the changes, will set the apply flag to false.
/// Print a diff of the changes, will not write the changes to disk.
#[arg(long, default_value_t = false)]
diff: bool,
/// Whether to apply possible changes.
#[arg(long, default_value_t = true)]
apply: bool,

#[command(subcommand)]
subcommand: Command,
Expand Down Expand Up @@ -53,10 +50,6 @@ impl CliArgs {
pub fn diff(&self) -> bool {
self.diff
}

pub fn apply(&self) -> bool {
self.apply
}
}

#[derive(Subcommand, Debug)]
Expand Down
8 changes: 3 additions & 5 deletions src/bin/flake-edit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ fn main() -> eyre::Result<()> {
let new = resulting_change;
let diff = Diff::new(&old, &new);
diff.compare();
// Write the changes
} else if args.apply() {
} else {
app.root.apply(&resulting_change)?;
}
} else if !args.list() && !args.update() && !args.pin() {
Expand Down Expand Up @@ -170,8 +169,7 @@ fn main() -> eyre::Result<()> {
let new = change;
let diff = Diff::new(&old, &new);
diff.compare();
// Write the changes
} else if args.apply() {
} else {
app.root.apply(&change)?;
}
}
Expand Down Expand Up @@ -208,7 +206,7 @@ fn main() -> eyre::Result<()> {
let new = change;
let diff = Diff::new(&old, &new);
diff.compare();
} else if args.apply() {
} else {
app.root.apply(&change)?;
}
}
Expand Down

0 comments on commit 066c55d

Please sign in to comment.