summaryrefslogtreecommitdiffstats
path: root/cmd/reddit.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/reddit.go')
-rw-r--r--cmd/reddit.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/cmd/reddit.go b/cmd/reddit.go
index 1096a23..194fdab 100644
--- a/cmd/reddit.go
+++ b/cmd/reddit.go
@@ -82,8 +82,7 @@ func init() {
}
func runRedditSubredditPosts(cmd *cobra.Command, args []string) error {
- apiKey, _ := cmd.Flags().GetString("api-key")
- cfg := config.New().WithAPIKey(apiKey)
+ cfg := config.New()
c, err := client.New(cfg)
if err != nil {
@@ -107,8 +106,7 @@ func runRedditSubredditPosts(cmd *cobra.Command, args []string) error {
}
func runRedditSubredditComments(cmd *cobra.Command, args []string) error {
- apiKey, _ := cmd.Flags().GetString("api-key")
- cfg := config.New().WithAPIKey(apiKey)
+ cfg := config.New()
c, err := client.New(cfg)
if err != nil {
@@ -132,8 +130,7 @@ func runRedditSubredditComments(cmd *cobra.Command, args []string) error {
}
func runRedditUserPosts(cmd *cobra.Command, args []string) error {
- apiKey, _ := cmd.Flags().GetString("api-key")
- cfg := config.New().WithAPIKey(apiKey)
+ cfg := config.New()
c, err := client.New(cfg)
if err != nil {
@@ -157,8 +154,7 @@ func runRedditUserPosts(cmd *cobra.Command, args []string) error {
}
func runRedditUserComments(cmd *cobra.Command, args []string) error {
- apiKey, _ := cmd.Flags().GetString("api-key")
- cfg := config.New().WithAPIKey(apiKey)
+ cfg := config.New()
c, err := client.New(cfg)
if err != nil {
@@ -182,8 +178,7 @@ func runRedditUserComments(cmd *cobra.Command, args []string) error {
}
func runRedditUserAbout(cmd *cobra.Command, args []string) error {
- apiKey, _ := cmd.Flags().GetString("api-key")
- cfg := config.New().WithAPIKey(apiKey)
+ cfg := config.New()
c, err := client.New(cfg)
if err != nil {