| 1 | package CSAF::Util::App; | ||
| 2 | |||
| 3 | use 5.010001; | ||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | use utf8; | ||
| 7 | |||
| 8 | use Exporter 'import'; | ||
| 9 | our @EXPORT_OK = (qw[cli_error cli_version]); | ||
| 10 | |||
| 11 | sub cli_error { | ||
| 12 | my ($error) = @_; | ||
| 13 | $error =~ s/ at .* line \d+.*//; | ||
| 14 | print STDERR "ERROR: $error\n"; | ||
| 15 | } | ||
| 16 | |||
| 17 | sub cli_version { | ||
| 18 | |||
| 19 | (my $progname = $0) =~ s/.*\///; | ||
| 20 | |||
| 21 | require CSAF; | ||
| 22 | |||
| 23 | say <<"VERSION"; | ||
| 24 | $progname version $CSAF::VERSION | ||
| 25 | |||
| 26 | Copyright 2023-2025, Giuseppe Di Terlizzi <gdt\@cpan.org> | ||
| 27 | |||
| 28 | This program is part of the CSAF distribution and is free software; | ||
| 29 | you can redistribute it and/or modify it under the same terms as Perl itself. | ||
| 30 | |||
| 31 | Complete documentation for $progname can be found using 'man $progname' | ||
| 32 | or on the internet at <https://metacpan.org/dist/CSAF>. | ||
| 33 | VERSION | ||
| 34 | |||
| 35 | return 0; | ||
| 36 | |||
| 37 | } | ||
| 38 | |||
| 39 | 1; | ||
| 40 | |||
| 41 | __END__ |