From f84b658530c0c0eaaaa0473add8c8c359fa6b09e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 16 Feb 2026 22:39:51 +0000 Subject: feat: add --offline flag to list, checkout, apply commands Skip network fetch when --offline is set, using only local cache --- src/bin/ngit/main.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/bin/ngit/main.rs') diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index 77ef955..5458251 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs @@ -49,13 +49,22 @@ async fn main() { } }, Commands::Init(args) => sub_commands::init::launch(&cli, args).await, - Commands::List { status, json, id } => { - sub_commands::list::launch(status.clone(), *json, id.clone()).await - } + Commands::List { + status, + json, + id, + offline, + } => sub_commands::list::launch(status.clone(), *json, id.clone(), *offline).await, Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await, Commands::Sync(args) => sub_commands::sync::launch(args).await, - Commands::Checkout { id } => sub_commands::checkout::launch(id).await, - Commands::Apply { id, stdout } => sub_commands::apply::launch(id, *stdout).await, + Commands::Checkout { id, offline } => { + sub_commands::checkout::launch(id, *offline).await + } + Commands::Apply { + id, + stdout, + offline, + } => sub_commands::apply::launch(id, *stdout, *offline).await, } } else { // Handle the case where no command is provided -- cgit v1.2.3