Opened 4 years ago
#3 new enhancement
Add MOVELINE command to relocate an existing line
Reported by: | Lewis Rosenthal | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | component1 | Version: | |
Keywords: | Cc: |
Description
CUBE lacks the ability to relocate an existing line with all options on it to another place in the same file. This RFE addresses this shortcoming by adding a MOVELINE (ML) command as follows:
MOVELINE MOVE an existing LINE of Target File from one position to another. The d-string identifies the line to be moved. If the line is not found within Target File, the new line may be added to the Target File. ┌───────────────────────────────┐ │ MOVELINE lineid [( options] │ └───────────────────────────────┘ Command Abbreviation : ML lineid : d-string to identify line options : [ ALL | FIRST | LAST ] [ MOVETOP | MOVEBOTTOM ] [ *ID ] [ RS(x) ] [ IF "x" ] [ IFNOT "x" ] ALL : moves ALL occurences of 'lineid' (default) FIRST : only moves 1st occurrences of 'lineid' LAST : only moves last occurrence of 'lineid' AFTER x : move after line identified by d-string x. If x is not specified or not present in Target file, line will be added at bottom of Target File. BEFORE x : move before line identified by d-string x. If x is not specified or not present in Target File, line will be added at top of Target File. ONLY : with AFTER/BEFORE: move only if x there IFNEW x : add line identified by d-string x if 'lineid' not already there. *ID : target line identification anywhere in the line. RS(x) : replace string(s) within the moved line. x is a single character used as a string delimiter for the duration of this command only; all strings delimited by a pair of x, in the moved line, will be interpreted as environment variable names replaced by their value. IF "x" : Move only if a line identified by "x" exists in the Target File. IFNOT "x" : Move only if a line identified by "x" doesn't exist in Target File.
The use case for this type of operation would be to preserve unknown (to CUBE) options on the line while relocating it to another place within the file (typically, CONFIG.SYS).
The RS(x) function allows for the possibility of specifically removing, say, deprecated option parameters from the line being moved while preserving the remainder. New, required, options may be inserted in the moved line in the same way.
IFNEW x allows for ADDLINE processing if no match is found to move.