Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions modules/message.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,38 @@ function message {
log_comment_and_exit1 "Error: You do not have an authorized access token" "To get access token, run $BASENAME message gitter apitoken"
fi
;;
"")
if check_apitoken gitter; then


echo "You must provide a subcommand for $BASENAME message gitter listed below:"
echo " $BASENAME message gitter apitoken"
echo " Check for API token for gitter"
echo
echo " $BASENAME message gitter authorize \"1234567890\""
echo " Sets and saves API token"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this:
speak about success
and show api token

echo
echo " $BASENAME message gitter channels"
echo " check for channels"
echo
echo " $BASENAME message gitter send treehouses/Lobby \"Hi, you are very awesome\""
echo " Sends a message to a gitter channel"
echo
echo " $BASENAME message gitter show treehouses/Lobby"
echo " Marks unread messages from a gitter channel to read"
echo
echo " $BASENAME message gitter read treehouses/Lobby"
echo " Receives and displays unread messages from a gitter channel"
echo
echo " $BASENAME message gitter mark treehouses/Lobby"
echo " Marks unread messages from a gitter channel to read"
echo
else
echo "You do not have a gitter apitoken setup."
echo "For instructions to configure your gitter apitoken"
echo "Please run: $BASENAME message gitter apitoken"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message could also run $BASENAME message gitter apitoken at the end since that's the only decision path and lowers the drop-off rate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test that out, thanks.

fi
;;
*)
log_help_and_exit1 "Error: This command does not exist" message
;;
Expand Down