MCPcopy Index your code
hub / github.com/dnote/dnote / NewCmd

Function NewCmd

pkg/cli/cmd/sync/sync.go:47–61  ·  view source on GitHub ↗

NewCmd returns a new sync command

(ctx context.DnoteCtx)

Source from the content-addressed store, hash-verified

45
46// NewCmd returns a new sync command
47func NewCmd(ctx context.DnoteCtx) *cobra.Command {
48 cmd := &cobra.Command{
49 Use: "sync",
50 Aliases: []string{"s"},
51 Short: "Sync data with the server",
52 Example: example,
53 RunE: newRun(ctx),
54 }
55
56 f := cmd.Flags()
57 f.BoolVarP(&isFullSync, "full", "f", false, "perform a full sync instead of incrementally syncing only the changed data.")
58 f.StringVar(&apiEndpointFlag, "apiEndpoint", "", "API endpoint to connect to (defaults to value in config)")
59
60 return cmd
61}
62
63func getLastSyncAt(tx *database.DB) (int, error) {
64 var ret int

Callers 1

mainFunction · 0.92

Calls 1

newRunFunction · 0.70

Tested by

no test coverage detected