Created
December 5, 2018 00:13
-
-
Save Adron/dd26fb08bf602f33a619b1280c290402 to your computer and use it in GitHub Desktop.
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
package cmd | |
import ( | |
"fmt" | |
"github.com/spf13/cobra" | |
"github.com/spf13/viper" | |
) | |
// configCmd represents the config command | |
var configCmd = &cobra.Command{ | |
Use: "config", | |
Short: "A brief description of your command", | |
Long: `A longer description that spans multiple lines and likely contains examples | |
and usage of using your command. For the custom example: | |
Cobra is a CLI library for Go that empowers applications. | |
This application is a tool to generate the needed files | |
to quickly create a Cobra application.`, | |
Run: func(cmd *cobra.Command, args []string) { | |
fmt.Printf("Twitterers File: %s\n", viper.GetString("file")) | |
fmt.Printf("Export File: %s\n", viper.GetString("fileExport")) | |
fmt.Printf("Export Format: %s\n", viper.GetString("fileFormat"))<span data-mce-type="bookmark" id="mce_SELREST_start" data-mce-style="overflow:hidden;line-height:0" style="overflow:hidden;line-height:0;"></span> | |
}, | |
} | |
func init() { | |
rootCmd.AddCommand(configCmd) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment