diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-16 22:39:51 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-17 11:38:24 +0000 |
| commit | f84b658530c0c0eaaaa0473add8c8c359fa6b09e (patch) | |
| tree | 51617dde282f6d1161fdbf9b929a9f1e8f9ead6c /src/bin/ngit/cli.rs | |
| parent | 17d31258117ec51d0e79c488ed8f863ad47b945f (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/cli.rs')
| -rw-r--r-- | src/bin/ngit/cli.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index c77e719..85c74cd 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs | |||
| @@ -117,11 +117,17 @@ pub enum Commands { | |||
| 117 | json: bool, | 117 | json: bool, |
| 118 | /// Show details for specific proposal (event-id or nevent) | 118 | /// Show details for specific proposal (event-id or nevent) |
| 119 | id: Option<String>, | 119 | id: Option<String>, |
| 120 | /// Use local cache only, skip network fetch | ||
| 121 | #[arg(long)] | ||
| 122 | offline: bool, | ||
| 120 | }, | 123 | }, |
| 121 | /// checkout a proposal branch by event-id or nevent | 124 | /// checkout a proposal branch by event-id or nevent |
| 122 | Checkout { | 125 | Checkout { |
| 123 | /// Proposal event-id (hex) or nevent (bech32) | 126 | /// Proposal event-id (hex) or nevent (bech32) |
| 124 | id: String, | 127 | id: String, |
| 128 | /// Use local cache only, skip network fetch | ||
| 129 | #[arg(long)] | ||
| 130 | offline: bool, | ||
| 125 | }, | 131 | }, |
| 126 | /// apply proposal patches to current branch | 132 | /// apply proposal patches to current branch |
| 127 | Apply { | 133 | Apply { |
| @@ -130,6 +136,9 @@ pub enum Commands { | |||
| 130 | /// Output patches to stdout instead of applying | 136 | /// Output patches to stdout instead of applying |
| 131 | #[arg(long)] | 137 | #[arg(long)] |
| 132 | stdout: bool, | 138 | stdout: bool, |
| 139 | /// Use local cache only, skip network fetch | ||
| 140 | #[arg(long)] | ||
| 141 | offline: bool, | ||
| 133 | }, | 142 | }, |
| 134 | /// update repo git servers to reflect nostr state (add, update or delete | 143 | /// update repo git servers to reflect nostr state (add, update or delete |
| 135 | /// remote refs) | 144 | /// remote refs) |