From db3d08fbdc95bc30b954fe551040ee18e5554184 Mon Sep 17 00:00:00 2001 From: Kithmini Gunawardhana Date: Fri, 15 Dec 2023 19:19:55 +0530 Subject: [PATCH] Added additional emptiness check for sashi json command (#318) --- sashi-cli/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sashi-cli/main.cpp b/sashi-cli/main.cpp index 208094d..fc37b4f 100644 --- a/sashi-cli/main.cpp +++ b/sashi-cli/main.cpp @@ -135,14 +135,14 @@ int parse_cmd(int argc, char **argv) if (!is_dev_mode) { if(create->parsed()){ - std::cout << "Developer mode must be enabled to access this command." << std::endl; + std::cout << "Command not supported: Run with --help or --help-all for more information." << std::endl; return -1; } - if(json->parsed()){ + if(json->parsed() && !json_message.empty()){ jsoncons::json json_data = jsoncons::json::parse(json_message); if (json_data.contains("type") && json_data["type"].as_string() == "create") { - std::cout << "Developer mode must be enabled to access this command." << std::endl; + std::cout << "Command not supported: Run with --help or --help-all for more information." << std::endl; return -1; } }