github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/kbfstool/git_main.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/keybase/client/go/kbfs/libkbfs"
     7  	"golang.org/x/net/context"
     8  )
     9  
    10  const gitUsageStr = `Usage:
    11    kbfstool git [<subcommand>] [<args>]
    12  
    13  The possible subcommands are:
    14    rename	Rename a git repository
    15  `
    16  
    17  func gitMain(ctx context.Context, config libkbfs.Config, args []string) (exitStatus int) {
    18  	if len(args) < 1 {
    19  		fmt.Print(gitUsageStr)
    20  		return 1
    21  	}
    22  
    23  	cmd := args[0]
    24  	args = args[1:]
    25  
    26  	switch cmd {
    27  	case "rename":
    28  		return gitRename(ctx, config, args)
    29  	default:
    30  		printError("git", fmt.Errorf("unknown command %q", cmd))
    31  		return 1
    32  	}
    33  }