upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/main.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-16 22:39:51 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-17 11:38:24 +0000
commitf84b658530c0c0eaaaa0473add8c8c359fa6b09e (patch)
tree51617dde282f6d1161fdbf9b929a9f1e8f9ead6c /src/bin/ngit/main.rs
parent17d31258117ec51d0e79c488ed8f863ad47b945f (diff)
feat: add --offline flag to list, checkout, apply commands
Skip network fetch when --offline is set, using only local cache
Diffstat (limited to 'src/bin/ngit/main.rs')
-rw-r--r--src/bin/ngit/main.rs19
1 files changed, 14 insertions, 5 deletions
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() {
49 } 49 }
50 }, 50 },
51 Commands::Init(args) => sub_commands::init::launch(&cli, args).await, 51 Commands::Init(args) => sub_commands::init::launch(&cli, args).await,
52 Commands::List { status, json, id } => { 52 Commands::List {
53 sub_commands::list::launch(status.clone(), *json, id.clone()).await 53 status,
54 } 54 json,
55 id,
56 offline,
57 } => sub_commands::list::launch(status.clone(), *json, id.clone(), *offline).await,
55 Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await, 58 Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await,
56 Commands::Sync(args) => sub_commands::sync::launch(args).await, 59 Commands::Sync(args) => sub_commands::sync::launch(args).await,
57 Commands::Checkout { id } => sub_commands::checkout::launch(id).await, 60 Commands::Checkout { id, offline } => {
58 Commands::Apply { id, stdout } => sub_commands::apply::launch(id, *stdout).await, 61 sub_commands::checkout::launch(id, *offline).await
62 }
63 Commands::Apply {
64 id,
65 stdout,
66 offline,
67 } => sub_commands::apply::launch(id, *stdout, *offline).await,
59 } 68 }
60 } else { 69 } else {
61 // Handle the case where no command is provided 70 // Handle the case where no command is provided