aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-16 23:47:50 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-06-16 23:47:50 +0530
commitd48bd9998de57d99d13c702b783d1c83cdd15629 (patch)
treee36b52d4327d28e6787a5065c4bd556bad076b41
parentc45cb6ebe10084d10f4fcf6189f26199f0913402 (diff)
added help messages
-rw-r--r--cmd/login.go14
-rw-r--r--cmd/logout.go2
-rw-r--r--cmd/root.go20
-rw-r--r--cmd/search.go9
-rw-r--r--cmd/status.go8
-rw-r--r--cmd/user_info.go2
6 files changed, 35 insertions, 20 deletions
diff --git a/cmd/login.go b/cmd/login.go
index d483767..9eed0a3 100644
--- a/cmd/login.go
+++ b/cmd/login.go
@@ -25,8 +25,18 @@ import (
var loginCmd = &cobra.Command {
Use: "login",
- Short: "Login with your MyAnimeList account.",
- Long: ``,
+ Short: "Login with your MyAnimeList account",
+ Long: "To authenticate with macli, a Client ID is required.\n" +
+ "If you have logged in before and ran `macli logout`, you may not need to enter your Client ID again unless you specifically deleted it.\n" +
+ "\n" +
+ "\x1b[31;1mHow to generate a Client ID:\x1b[0m\n" +
+ " - Go to \x1b[36mhttps://myanimelist.net/apiconfig\x1b[0m\n" +
+ " - Click on \x1b[33m\"Create ID\"\x1b[0m\n" +
+ " - Inside the form you can set all the details to whatever you'd like\n" +
+ " - For macli to work properly, you only need to set \x1b[33m\"App Redirect Url\"\x1b[0m to \x1b[36mhttp://localhost:8000\x1b[0m\n" +
+ " - After that, hit submit, then copy your Client ID, run `macli login` and paste in your Client ID.\n" +
+ " - \x1b[31mIf after running `macli login` it opens a dialogue box in the browser asking for credentials,\n and not the MyAnimeList login page, that means you have entered your Client ID wrong.\x1b[0m\n" +
+ "",
Run: func(cmd *cobra.Command, args []string) {
auth.Login()
},
diff --git a/cmd/logout.go b/cmd/logout.go
index 403f6aa..0826782 100644
--- a/cmd/logout.go
+++ b/cmd/logout.go
@@ -27,7 +27,7 @@ var logoutCmd = &cobra.Command {
Use: "logout",
Short: "Logout from macli",
Long: `Logout from macli
-This will delete the Auth Token and Client ID from system's keyring.
+This will delete the Auth Token and Client ID (if prompted) from system's keyring.
`,
Run: func(cmd *cobra.Command, args []string) {
auth.Logout()
diff --git a/cmd/root.go b/cmd/root.go
index 0914da1..2ac48d6 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -28,16 +28,16 @@ var rootCmd = &cobra.Command{
Use: "macli",
Short: "macli - Unofficial CLI-Based MyAnimeList Client.",
Long: "macli is an unofficial MyAnimeClient for use inside the terminal.\n" +
-"\n" +
-"\x1b[34mmacli Copyright (C) 2022 Vidhu Kant Sharma <vidhukant@vidhukant.xyz>\n" +
-"This program comes with ABSOLUTELY NO WARRANTY;\n" +
-"This is free software, and you are welcome to redistribute it\n" +
-"under certain conditions; For details refer to the GNU General Public License.\n" +
-"You should have received a copy of the GNU General Public License\n" +
-"along with this program. If not, see <https://www.gnu.org/licenses/>.\x1b[0m\n" +
-"\n" +
-"\x1b[35mPlease report any bugs on the GitHub page https://github.com/MikunoNaka/macli\n" +
-"or through email: vidhukant@vidhukant.xyz\x1b[0m\n",
+ "\n" +
+ "\x1b[34mmacli Copyright (C) 2022 Vidhu Kant Sharma <vidhukant@vidhukant.xyz>\n" +
+ "This program comes with ABSOLUTELY NO WARRANTY;\n" +
+ "This is free software, and you are welcome to redistribute it\n" +
+ "under certain conditions; For details refer to the GNU General Public License.\n" +
+ "You should have received a copy of the GNU General Public License\n" +
+ "along with this program. If not, see <https://www.gnu.org/licenses/>.\x1b[0m\n" +
+ "\n" +
+ "\x1b[35mPlease report any bugs on the GitHub page: https://github.com/MikunoNaka/macli\n" +
+ "or through email: vidhukant@vidhukant.xyz\x1b[0m\n",
}
func Execute() {
diff --git a/cmd/search.go b/cmd/search.go
index da57862..2e485e3 100644
--- a/cmd/search.go
+++ b/cmd/search.go
@@ -27,9 +27,12 @@ import (
var searchCmd = &cobra.Command {
Use: "search",
Short: "Search for an anime/manga",
- Long: `
--- help/description to be added later
-`,
+ Long: "Search for an anime or a manga on MyAnimeList\n" +
+ "\n" +
+ "Example Usage:\n" +
+ "\t\x1b[33m`macli search <anime-name>`\x1b[0m searches for an anime\n" +
+ "\t\x1b[33m`macli search -m <manga-name>`\x1b[0m searches for a manga\n" +
+ "\t\x1b[33m`macli search`\x1b[0m interactively asks for an anime to search for (same for manga with -m/--manga flag)\n",
Run: func(cmd *cobra.Command, args []string) {
// read searchInput from command
searchInput := strings.Join(args, " ")
diff --git a/cmd/status.go b/cmd/status.go
index e80386c..feb5c10 100644
--- a/cmd/status.go
+++ b/cmd/status.go
@@ -31,9 +31,11 @@ import (
var statusCmd = &cobra.Command{
Use: "status",
Short: "Set an anime/manga's status",
- Long: `
--- help/description to be added later
-`,
+ Long: "Set an anime's status\n" +
+ "\n" +
+ "Example Usage:\n" +
+ " - \x1b[33m`macli status <anime-name>`\x1b[0m For interactive prompt (anime-name can be omitted)\n" +
+ " - \x1b[33m`macli status -s \x1b[34mwatching|plan_to_watch|dropped|on_hold|completed\x1b[33m <anime-name>`\x1b[0m to specify status from command\n",
Run: func(cmd *cobra.Command, args []string) {
searchInput := strings.Join(args, " ")
diff --git a/cmd/user_info.go b/cmd/user_info.go
index 7c9387a..46b2954 100644
--- a/cmd/user_info.go
+++ b/cmd/user_info.go
@@ -29,7 +29,7 @@ var userInfoCmd = &cobra.Command {
Short: "Shows logged-in user's info",
Long:
`Print logged-in user's profile information.
-Currently, MyAnimeList doesn't allow reading of other users' profiles
+Currently, MyAnimeList doesn't allow reading of other users' profiles.
`,
Run: func(cmd *cobra.Command, args []string) {
userInfo := mal.GetUserInfo()