git-lfs/commands/command_init.go

41 lines
1.1 KiB
Go
Raw Normal View History

package commands
import (
2015-11-16 20:31:26 +00:00
"fmt"
"os"
2015-05-25 18:20:50 +00:00
"github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra"
)
2015-11-16 20:39:58 +00:00
// TODO: Remove for Git LFS v2.0
2014-06-26 20:15:21 +00:00
var (
initCmd = &cobra.Command{
2015-09-17 22:08:28 +00:00
Use: "init",
Run: initCommand,
2014-06-26 20:15:21 +00:00
}
2014-06-26 21:32:32 +00:00
initHooksCmd = &cobra.Command{
2015-09-17 22:08:28 +00:00
Use: "hooks",
Run: initHooksCommand,
}
2014-06-26 21:32:32 +00:00
)
2014-06-26 21:32:32 +00:00
func initCommand(cmd *cobra.Command, args []string) {
2015-11-16 20:31:26 +00:00
fmt.Fprintf(os.Stderr, "WARNING: 'git lfs init' is deprecated. Use 'git lfs install' now.\n")
installCommand(cmd, args)
}
2014-06-26 21:32:32 +00:00
func initHooksCommand(cmd *cobra.Command, args []string) {
2015-11-16 20:31:26 +00:00
fmt.Fprintf(os.Stderr, "WARNING: 'git lfs init' is deprecated. Use 'git lfs install' now.\n")
installHooksCommand(cmd, args)
}
func init() {
2015-11-16 20:31:26 +00:00
initCmd.Flags().BoolVarP(&forceInstall, "force", "f", false, "Set the Git LFS global config, overwriting previous values.")
initCmd.Flags().BoolVarP(&localInstall, "local", "l", false, "Set the Git LFS config for the local Git repository only.")
initCmd.Flags().BoolVarP(&skipSmudgeInstall, "skip-smudge", "s", false, "Skip automatic downloading of objects on clone or pull.")
2014-06-26 21:32:32 +00:00
initCmd.AddCommand(initHooksCmd)
2014-06-26 20:15:21 +00:00
RootCmd.AddCommand(initCmd)
}