From 4e824f4fff7e056c2f552f167fbe0e11b424c66d Mon Sep 17 00:00:00 2001 From: Lasse Tjernaes Wardenaer <lasse.tjernaes.wardenaer@cern.ch> Date: Tue, 11 Oct 2022 09:55:00 +0200 Subject: [PATCH] Resolve "Update Release Notes and small usage changes after changes to cta-verify-file" --- ReleaseNotes.md | 3 ++- cmdline/standalone_cli_tools/CtaVerifyFile.cpp | 2 +- .../standalone_cli_tools/common/CmdLineArgs.cpp | 17 +---------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index c06b6458b7..504bd5b62e 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -4,7 +4,8 @@ ### Features - cta/CTA#41 - Delete verification_status of tape when tape is reclaimed - cta/CTA#153 - Allow verification status to be cleared with cta-admin -### Bug fixes +- cta/CTA#173 - Update release notes and small changes to refactoring of operation tools cmd line parsing - Compatible with operations 0.4-95 or later +### Bug fixes - cta/CTA#161 - Fix bug when using temporary tables with PostgreSQL # v4.7.12-1 diff --git a/cmdline/standalone_cli_tools/CtaVerifyFile.cpp b/cmdline/standalone_cli_tools/CtaVerifyFile.cpp index d740a71d1e..34d0eb1daf 100644 --- a/cmdline/standalone_cli_tools/CtaVerifyFile.cpp +++ b/cmdline/standalone_cli_tools/CtaVerifyFile.cpp @@ -66,7 +66,7 @@ void fillNotification(cta::eos::Notification ¬ification, const int argc, char if(cmdLineArgs.m_help) { cmdLineArgs.printUsage(std::cout); exit(0); } - if(!cmdLineArgs.m_archiveFileId && !cmdLineArgs.m_vid) { + if(!cmdLineArgs.m_archiveFileId || !cmdLineArgs.m_vid) { cmdLineArgs.printUsage(std::cout); throw std::runtime_error("ERROR: Usage"); } diff --git a/cmdline/standalone_cli_tools/common/CmdLineArgs.cpp b/cmdline/standalone_cli_tools/common/CmdLineArgs.cpp index a6523c10aa..62149e2b44 100644 --- a/cmdline/standalone_cli_tools/common/CmdLineArgs.cpp +++ b/cmdline/standalone_cli_tools/common/CmdLineArgs.cpp @@ -81,22 +81,7 @@ m_help(false), m_debug(false), m_standaloneCliTool{standaloneCliTool} { opterr = 0; int opt = 0; - int opt_index; - - switch (standaloneCliTool) { - case StandaloneCliTool::RESTORE_FILES: - opt_index = 3; - break; - case StandaloneCliTool::CTA_SEND_EVENT: - opt_index = 3; - break; - case StandaloneCliTool::CTA_VERIFY_FILE: - opt_index = 2; - break; - default: - opt_index = 3; - break; - } + int opt_index = 0; while ((opt = getopt_long(argc, argv, shortopts[m_standaloneCliTool], longopts[m_standaloneCliTool], &opt_index)) != -1) { switch(opt) { -- GitLab