~rockorager/offmap

offmap: offmap: add -a, --account flag v1 SUPERSEDED

Tim Culverhouse: 1
 offmap: add -a, --account flag

 2 files changed, 18 insertions(+), 0 deletions(-)
#899031 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rockorager/offmap/patches/37361/mbox | git am -3
Learn more about email & git

[PATCH offmap] offmap: add -a, --account flag Export this patch

Add a flag to sync the specified account

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
---
 cmd/diff.go | 9 +++++++++
 cmd/sync.go | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/cmd/diff.go b/cmd/diff.go
index 6855bf4..d0844f6 100644
--- a/cmd/diff.go
+++ b/cmd/diff.go
@@ -16,6 +16,7 @@ func newDiffCommand() *cobra.Command {
		Short: "diff enumerates changes from last sync for a mailstore",
		Run:   diff,
	}
	cmd.Flags().StringP("account", "a", "", "only diff the specified account")
	return cmd
}

@@ -26,7 +27,15 @@ func diff(cmd *cobra.Command, args []string) {
	if err != nil {
		log.Fatalf("could not read config: %v", err)
	}
	acct, err := cmd.Flags().GetString("account")
	if err != nil {
		log.Errorf("offmap: could not parse account: %v", err)
		return
	}
	for _, cfg := range cfgs {
		if acct != "" && acct != cfg.Name {
			continue
		}
		start := time.Now()

		// Bootstrap the app
diff --git a/cmd/sync.go b/cmd/sync.go
index de6782d..4dcd6a2 100644
--- a/cmd/sync.go
+++ b/cmd/sync.go
@@ -16,6 +16,7 @@ func newSyncCommand() *cobra.Command {
		Short: "sync synchronizes mail stores",
		Run:   sync,
	}
	cmd.Flags().StringP("account", "a", "", "only sync the specified account")
	return cmd
}

@@ -26,7 +27,15 @@ func sync(cmd *cobra.Command, args []string) {
	if err != nil {
		log.Debugf("%v", err)
	}
	acct, err := cmd.Flags().GetString("account")
	if err != nil {
		log.Errorf("offmap: could not parse account: %v", err)
		return
	}
	for _, cfg := range cfgs {
		if acct != "" && acct != cfg.Name {
			continue
		}
		log.Infof("offmap: syncing account %s", cfg.Name)
		start := time.Now()

-- 
2.38.1
offmap/patches/.build.yml: SUCCESS in 1m54s

[offmap: add -a, --account flag][0] from [Tim Culverhouse][1]

[0]: https://lists.sr.ht/~rockorager/offmap/patches/37361
[1]: mailto:tim@timculverhouse.com

✓ #899031 SUCCESS offmap/patches/.build.yml https://builds.sr.ht/~rockorager/job/899031