-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
1,089 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package cmd | ||
|
||
import ( | ||
// "fmt" | ||
// "os" | ||
|
||
// homedir "github.com/mitchellh/go-homedir" | ||
"github.com/spf13/cobra" | ||
// "github.com/spf13/viper" | ||
) | ||
|
||
// var cfgFile string | ||
|
||
// rootCmd represents the base command when called without any subcommands | ||
var rootCmd = &cobra.Command{ | ||
Use: "supabase", | ||
Short: "TODO", | ||
Long: `TODO`, | ||
} | ||
|
||
// Execute adds all child commands to the root command and sets flags appropriately. | ||
// This is called by main.main(). It only needs to happen once to the rootCmd. | ||
func Execute() { | ||
cobra.CheckErr(rootCmd.Execute()) | ||
} | ||
|
||
func init() { | ||
// cobra.OnInitialize(initConfig) | ||
|
||
// Here you will define your flags and configuration settings. | ||
// Cobra supports persistent flags, which, if defined here, | ||
// will be global for your application. | ||
|
||
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cli.yaml)") | ||
|
||
// Cobra also supports local flags, which will only run | ||
// when this action is called directly. | ||
// rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
} | ||
|
||
// initConfig reads in config file and ENV variables if set. | ||
// func initConfig() { | ||
// if cfgFile != "" { | ||
// // Use config file from the flag. | ||
// viper.SetConfigFile(cfgFile) | ||
// } else { | ||
// // Find home directory. | ||
// home, err := homedir.Dir() | ||
// cobra.CheckErr(err) | ||
// | ||
// // Search config in home directory with name ".cli" (without extension). | ||
// viper.AddConfigPath(home) | ||
// viper.SetConfigName(".cli") | ||
// } | ||
// | ||
// viper.AutomaticEnv() // read in environment variables that match | ||
// | ||
// // If a config file is found, read it in. | ||
// if err := viper.ReadInConfig(); err == nil { | ||
// fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed()) | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// Passed from `-ldflags`. See https://stackoverflow.com/questions/11354518/application-auto-build-versioning. | ||
var version string | ||
|
||
var versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "TODO", | ||
Long: `TODO`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println(version) | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(versionCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// versionCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
// versionCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module github.com/supabase/cli | ||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/containerd/containerd v1.5.2 // indirect | ||
github.com/docker/docker v20.10.7+incompatible | ||
github.com/docker/go-connections v0.4.0 // indirect | ||
github.com/morikuni/aec v1.0.0 // indirect | ||
github.com/spf13/cobra v1.1.3 | ||
) |
Oops, something went wrong.