From 85caa38c7b45766f044a016b88a410f75cb7469e Mon Sep 17 00:00:00 2001 From: sinner Date: Mon, 19 Jan 2026 06:02:10 -0500 Subject: feat: add command aliases for improved cli usability --- cmd/reddit.go | 76 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 34 deletions(-) (limited to 'cmd/reddit.go') diff --git a/cmd/reddit.go b/cmd/reddit.go index bb31336..7a5da71 100644 --- a/cmd/reddit.go +++ b/cmd/reddit.go @@ -7,61 +7,69 @@ import ( ) var redditCmd = &cobra.Command{ - Use: "reddit", - Short: "Reddit data retrieval tools", - Long: `Retrieve posts, comments, and user information from Reddit`, + Use: "reddit", + Aliases: []string{"rd"}, + Short: "Reddit data retrieval tools", + Long: `Retrieve posts, comments, and user information from Reddit`, } var redditSubredditCmd = &cobra.Command{ - Use: "subreddit", - Short: "Get subreddit data", - Long: `Retrieve posts or comments from a subreddit`, + Use: "subreddit", + Aliases: []string{"sr"}, + Short: "Get subreddit data", + Long: `Retrieve posts or comments from a subreddit`, } var redditUserCmd = &cobra.Command{ - Use: "user", - Short: "Get Reddit user data", - Long: `Retrieve posts, comments, or profile information for a Reddit user`, + Use: "user", + Aliases: []string{"u"}, + Short: "Get Reddit user data", + Long: `Retrieve posts, comments, or profile information for a Reddit user`, } var redditSubredditPostsCmd = &cobra.Command{ - Use: "posts [subreddit]", - Short: "Get subreddit posts", - Long: `Get up to 1000 recent posts from a subreddit`, - Args: cobra.ExactArgs(1), - RunE: runRedditSubredditPosts, + Use: "posts [subreddit]", + Aliases: []string{"p"}, + Short: "Get subreddit posts", + Long: `Get up to 1000 recent posts from a subreddit`, + Args: cobra.ExactArgs(1), + RunE: runRedditSubredditPosts, } var redditSubredditCommentsCmd = &cobra.Command{ - Use: "comments [subreddit]", - Short: "Get subreddit comments", - Long: `Get up to 1000 recent comments from a subreddit`, - Args: cobra.ExactArgs(1), - RunE: runRedditSubredditComments, + Use: "comments [subreddit]", + Aliases: []string{"c"}, + Short: "Get subreddit comments", + Long: `Get up to 1000 recent comments from a subreddit`, + Args: cobra.ExactArgs(1), + RunE: runRedditSubredditComments, } var redditUserPostsCmd = &cobra.Command{ - Use: "posts [username]", - Short: "Get user posts", - Long: `Get up to 1000 recent posts from a Reddit user`, - Args: cobra.ExactArgs(1), - RunE: runRedditUserPosts, + Use: "posts [username]", + Aliases: []string{"p"}, + Short: "Get user posts", + Long: `Get up to 1000 recent posts from a Reddit user`, + Args: cobra.ExactArgs(1), + RunE: runRedditUserPosts, } var redditUserCommentsCmd = &cobra.Command{ - Use: "comments [username]", - Short: "Get user comments", - Long: `Get up to 1000 recent comments from a Reddit user`, - Args: cobra.ExactArgs(1), - RunE: runRedditUserComments, + Use: "comments [username]", + Aliases: []string{"c"}, + Short: "Get user comments", + Long: `Get up to 1000 recent comments from a Reddit user`, + Args: cobra.ExactArgs(1), + RunE: runRedditUserComments, } var redditUserAboutCmd = &cobra.Command{ - Use: "about [username]", - Short: "Get user profile", - Long: `Get profile information for a Reddit user`, - Args: cobra.ExactArgs(1), - RunE: runRedditUserAbout, + Use: "about [username]", + Aliases: []string{"a"}, + Short: "Get user profile", + Long: `Get profile information for a Reddit user`, + Args: cobra.ExactArgs(1), + RunE: runRedditUserAbout, } func init() { -- cgit v1.2.3