From 2e3471f457c6768d075ac7b41e78426ae3fcea9d Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Thu, 22 Oct 2015 13:16:44 +0200 Subject: Add join/part aliases for going/!going --- src/event_main.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/event_main.cc b/src/event_main.cc index c7c867e..f9b7dde 100644 --- a/src/event_main.cc +++ b/src/event_main.cc @@ -400,7 +400,7 @@ bool help(std::vector& args) { std::ostringstream ss; if (args.empty()) { ss << "Usage: help COMMAND" << std::endl; - ss << "Known commands: create, update, cancel, show, going, !going"; + ss << "Known commands: create, update, cancel, show, going, !going, join, part"; } else if (args.front() == "create") { ss << "Usage: create NAME START [TEXT]" << std::endl; ss << "Create a new event with the name NAME starting at START with" @@ -420,18 +420,20 @@ bool help(std::vector& args) { ss << "Usage: show [INDEX...]" << std::endl; ss << "Show one or more events given by index" << " (default is next event)"; - } else if (args.front() == "going") { + } else if (args.front() == "going" || args.front() == "join") { ss << "Usage: going [user USER] [INDEX] [NOTE]" << std::endl; ss << "Join an event specified by index (default is next event)" << " and add an optional NOTE" << std::endl; ss << "If USER is specified, you're saying that USER is joining" - << " instead of yourself - use with caution"; - } else if (args.front() == "!going") { + << " instead of yourself - use with caution" << std::endl; + ss << "join is an alias for going"; + } else if (args.front() == "!going" || args.front() == "part") { ss << "Usage: !going [user USER] [INDEX] [NOTE]" << std::endl; ss << "Un-join an event specified by index (default is next event)" << " and add an optional NOTE" << std::endl; ss << "If USER is specified, you're saying that USER is not going" - << " instead of yourself - use with caution"; + << " instead of yourself - use with caution" << std::endl; + ss << "part is an alias for !going"; } else { ss << "Unknown command: " << args.front(); } @@ -491,10 +493,10 @@ bool handle_request(CGI* cgi) { if (command == "show") { return show(utils.get(), data, args); } - if (command == "going") { + if (command == "going" || command == "join") { return going(utils.get(), data, args, true); } - if (command == "!going") { + if (command == "!going" || command == "part") { return going(utils.get(), data, args, false); } if (command == "help") { -- cgit v1.2.3-70-g09d2