From 1d4e2d69dda60e5262ddc7edcb560418c3604dc0 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 13 Jun 2025 16:49:18 -0300 Subject: [PATCH] Bug 23883: sip_cli_emulator.pl should display real parameter names For creating this patch I looked at all parameters defined in the handler mapping, removed duplicated ones and tracked down which ones really were parameters in `GetOptions`. This included tracking down variables that were later assigned other values and things like that. The mapping is used to display the right parameter name if missing a mandatory one. --- misc/sip_cli_emulator.pl | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/misc/sip_cli_emulator.pl b/misc/sip_cli_emulator.pl index 139813d5c6c..23fd231784b 100755 --- a/misc/sip_cli_emulator.pl +++ b/misc/sip_cli_emulator.pl @@ -306,6 +306,31 @@ my $handlers = { }, }; +my $param_to_cli = { + currency_type => 'currency-type', + current_location => 'location', + end_item => 'end-item', + fee_acknowledged => 'fee-acknowledged', + fee_amount => 'fee-amount', + fee_identifier => 'fee-identifier', + fee_type => 'fee-type', + hold_mode => 'hold-mode', + institution_id => 'location', + item_identifier => 'item', + location_code => 'location', + login_password => 'sip_pass', + login_user_id => 'sip_user', + no_block => 'no-block', + patron_identifier => 'patron', + patron_password => 'password', + payment_type => 'payment-type', + pickup_location => 'pickup-location', + start_item => 'start-item', + summary => 'summary', + terminal_password => 'sip_pass', + transaction_id => 'transaction-id', +}; + my $data = run_command_message('login'); if ( $data =~ '^941' ) { ## we are logged in @@ -335,7 +360,8 @@ sub build_command_message { foreach my $key ( keys %$parameters ) { unless ( $parameters->{$key} ) { unless ( $optional{$key} ) { - say "$key is required for $message"; + my $param_name = $param_to_cli->{$key} // $key; + say "$param_name is required for $message"; return; } } -- 2.49.0