From 2cf43ec16ba3cc0527a22f4b89d989a94ffca7ce Mon Sep 17 00:00:00 2001 From: aldbr Date: Wed, 20 May 2026 16:43:10 +0200 Subject: [PATCH] fix: consolidate dirac-dms-add-file help into single Usage/Arguments blocks The module docstring used two 'Usage:' / 'Arguments:' blocks separated by '**OR**'. LocalConfiguration.setUsageMessage only keeps the FIRST match of each block (re.search), so the second invocation form and the LocalFile argument were dropped from both the --help output and the generated docs. Merge both invocation forms into one Usage block and all arguments into one Arguments block so nothing is lost. Closes #7290 Co-Authored-By: Claude Opus 4.7 (1M context) --- .../scripts/dirac_dms_add_file.py | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/DIRAC/DataManagementSystem/scripts/dirac_dms_add_file.py b/src/DIRAC/DataManagementSystem/scripts/dirac_dms_add_file.py index 4aee253342a..ffe43d41811 100755 --- a/src/DIRAC/DataManagementSystem/scripts/dirac_dms_add_file.py +++ b/src/DIRAC/DataManagementSystem/scripts/dirac_dms_add_file.py @@ -4,27 +4,24 @@ # Author : Stuart Paterson ######################################################################## """ -Upload a file to the grid storage and register it in the File Catalog +Upload a file to the grid storage and register it in the File Catalog. -Usage: - dirac-dms-add-file [options] ... LFN Path SE [GUID] - -Arguments: - LFN: Logical File Name - Path: Local path to the file - SE: DIRAC Storage Element - GUID: GUID to use in the registration (optional) - -**OR** +The file(s) to upload can be passed either directly as arguments, or listed in a +local text file given as the only argument (one upload per line). Usage: + dirac-dms-add-file [options] ... LFN Path SE [GUID] dirac-dms-add-file [options] ... LocalFile ... Arguments: - LocalFile: Path to local file containing all the above, i.e.:: - - lfn1 localfile1 SE [GUID1] - lfn2 localfile2 SE [GUID2] + LFN: Logical File Name + Path: Local path to the file + SE: DIRAC Storage Element + GUID: GUID to use in the registration (optional) + LocalFile: Path to a local file listing the uploads described above, one per line, i.e.:: + + lfn1 localfile1 SE [GUID1] + lfn2 localfile2 SE [GUID2] Example: $ dirac-dms-add-file LFN:/formation/user/v/vhamar/Example.txt Example.txt DIRAC-USER