Skip to content

Commit

Permalink
ZWEGEN00: verify the operation and verbosity (#3745)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Zeithaml <[email protected]>
  • Loading branch information
Martin-Zeithaml authored Jun 27, 2024
1 parent bbb3272 commit 4cf6e9d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions files/SZWEEXEC/ZWEGEN00
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@

parse arg operation verbosity

VALID_OPERATIONS = '"generate" | "nogenerate"'
VALID_VERBOSITY = '"verbose" | "noverbose"'

if POS(verbosity, VALID_VERBOSITY) = 0 then do
say 'Error: "'verbosity'" is not a valid verbosity.'
say ' Valid verbosity levels are: '||VALID_VERBOSITY
ExitWithRC(8)
end
!verbose = COMPARE(verbosity, 'noverbose')

/*
Expand Down Expand Up @@ -63,6 +71,12 @@ end
================================================================================
*/

if POS(operation, VALID_OPERATIONS) = 0 then do
say 'Error: "'operation'" is not a valid operation.'
say ' Valid operations are: '||VALID_OPERATIONS
ExitWithRC(8)
end

if COMPARE(operation, 'nogenerate') = 0 then do
exit 0
end
Expand Down

0 comments on commit 4cf6e9d

Please sign in to comment.