From cbc1eb8b0527b02e43f66029ff1f52371a6035a0 Mon Sep 17 00:00:00 2001 From: chen0088 Date: Wed, 22 Jun 2022 15:02:54 +0800 Subject: [PATCH] modify abnormal state Signed-off-by: chen0088 --- .../dcamera_sink_hidumper.cpp | 22 ++++++++++--------- .../dcamera_source_hidumper.cpp | 22 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/services/cameraservice/sinkservice/src/distributedcamera/dcamera_sink_hidumper.cpp b/services/cameraservice/sinkservice/src/distributedcamera/dcamera_sink_hidumper.cpp index 883d0e2..06b08a5 100644 --- a/services/cameraservice/sinkservice/src/distributedcamera/dcamera_sink_hidumper.cpp +++ b/services/cameraservice/sinkservice/src/distributedcamera/dcamera_sink_hidumper.cpp @@ -53,10 +53,10 @@ bool DcameraSinkHidumper::Dump(const std::vector& args, std::string if (args.empty()) { ShowHelp(result); - return DCAMERA_OK; + return true; } else if (args.size() > 1) { ShowIllegalInfomation(result); - return DCAMERA_OK; + return true; } if (ProcessDump(args[0], result) != DCAMERA_OK) { @@ -106,7 +106,7 @@ int32_t DcameraSinkHidumper::ProcessDump(const std::string& args, std::string& r int32_t DcameraSinkHidumper::GetLocalCameraNumber(std::string& result) { DHLOGI("GetLocalCameraNumber Dump."); - result.append("CameraNumber\n") + result.append("CameraNumber: ") .append(std::to_string(camDumpInfo_.camNumber)); return DCAMERA_OK; } @@ -126,7 +126,7 @@ int32_t DcameraSinkHidumper::GetOpenedCameraInfo(std::string& result) int32_t DcameraSinkHidumper::GetVersionInfo(std::string& result) { DHLOGI("GetVersionInfo Dump."); - result.append("CameraVersion\n") + result.append("CameraVersion: ") .append(camDumpInfo_.version); return DCAMERA_OK; } @@ -136,12 +136,14 @@ void DcameraSinkHidumper::ShowHelp(std::string& result) DHLOGI("ShowHelp Dump."); result.append("Usage:dump [options]\n") .append("Description:\n") - .append("--version ") - .append("dump camera version in the system\n") - .append("--camNum ") - .append("dump local camera numbers in the system\n") - .append("--opened ") - .append("dump the opened camera in the system\n"); + .append("-h ") + .append(": show help\n") + .append("--version ") + .append(": dump camera version in the system\n") + .append("--camNum ") + .append(": dump local camera numbers in the system\n") + .append("--opened ") + .append(": dump the opened camera in the system\n"); } int32_t DcameraSinkHidumper::ShowIllegalInfomation(std::string& result) diff --git a/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp b/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp index 9440dec..3db25a3 100644 --- a/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp +++ b/services/cameraservice/sourceservice/src/distributedcamera/dcamera_source_hidumper.cpp @@ -66,10 +66,10 @@ bool DcameraSourceHidumper::Dump(const std::vector& args, std::stri if (args.empty()) { ShowHelp(result); - return DCAMERA_OK; + return true; } else if (args.size() > 1) { ShowIllegalInfomation(result); - return DCAMERA_OK; + return true; } if (ProcessDump(args[0], result) != DCAMERA_OK) { @@ -119,7 +119,7 @@ int32_t DcameraSourceHidumper::ProcessDump(const std::string& args, std::string& int32_t DcameraSourceHidumper::GetRegisteredInfo(std::string& result) { DHLOGI("GetRegisteredInfo Dump."); - result.append("CameraNumber\n") + result.append("CameraNumber: ") .append(std::to_string(camDumpInfo_.regNumber)); return DCAMERA_OK; } @@ -151,7 +151,7 @@ int32_t DcameraSourceHidumper::GetCurrentStateInfo(std::string& result) int32_t DcameraSourceHidumper::GetVersionInfo(std::string& result) { DHLOGI("GetVersionInfo Dump."); - result.append("CameraVersion\n") + result.append("CameraVersion: ") .append(camDumpInfo_.version); return DCAMERA_OK; } @@ -161,12 +161,14 @@ void DcameraSourceHidumper::ShowHelp(std::string& result) DHLOGI("ShowHelp Dump."); result.append("Usage:dump [options]\n") .append("Description:\n") - .append("--version ") - .append("dump camera version in the system\n") - .append("--registered ") - .append("dump number of registered cameras in the system\n") - .append("--curState ") - .append("dump current state of the camera in the system\n"); + .append("-h ") + .append(": show help\n") + .append("--version ") + .append(": dump camera version in the system\n") + .append("--registered ") + .append(": dump number of registered cameras in the system\n") + .append("--curState ") + .append(": dump current state of the camera in the system\n"); } int32_t DcameraSourceHidumper::ShowIllegalInfomation(std::string& result)