42 lines
726 B
Go
42 lines
726 B
Go
package sync
|
|
|
|
import (
|
|
"cloudsave/pkg/remote"
|
|
"context"
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/google/subcommands"
|
|
)
|
|
|
|
type (
|
|
SyncCmd struct {
|
|
}
|
|
)
|
|
|
|
func (*SyncCmd) Name() string { return "sync" }
|
|
func (*SyncCmd) Synopsis() string { return "list all game registered" }
|
|
func (*SyncCmd) Usage() string {
|
|
return `add:
|
|
List all game registered
|
|
`
|
|
}
|
|
|
|
func (p *SyncCmd) SetFlags(f *flag.FlagSet) {
|
|
}
|
|
|
|
func (p *SyncCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
|
|
_, err := remote.All()
|
|
if err != nil {
|
|
fmt.Fprintln(os.Stderr, "error: failed to load datastore:", err)
|
|
return subcommands.ExitFailure
|
|
}
|
|
|
|
/*for _, remote := range remotes {
|
|
|
|
}*/
|
|
|
|
return subcommands.ExitSuccess
|
|
}
|