| 1 | package Class::Usul::Getopt::Usage; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 18 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 18 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 18 | ▶ | use parent 'Getopt::Long::Descriptive::Usage'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 18 | ▶ | use List::Util qw( max ); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | 18 | ▶ | use Term::ANSIColor qw( color ); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 18 | my $NUL = q(); my $SPC = q( ); my $USAGE_CONF = {}; | |||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||
| 12 | # Private functions | ||||||||||||||||||||||||||||||||
| 13 | 26 | ▶ | my $_tabstop = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||
| 14 | 26 | ▶ | my $v = $USAGE_CONF->{tabstop} // 3; return $v; # Eight is too much | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$USAGE_CONF->{"tabstop"} // 3
MC/DC0%0/1
$USAGE_CONF->{"tabstop"} // 3
$USAGE_CONF->{"tabstop"}
Truth table50%1/2
A
A= $USAGE_CONF->{"tabstop"}
| |||||||||||||||||||||||||||||||||
| 15 | 18 | }; | |||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 24 | ▶ | my $_split_description = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=26.1
| |||||||||||||||||||||||||||||||||
| 18 | 24 | ▶ | my ($length, $desc) = @_; my $width = $USAGE_CONF->{width} // 78; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$USAGE_CONF->{"width"} // 78
MC/DC0%0/1
$USAGE_CONF->{"width"} // 78
$USAGE_CONF->{"width"}
Truth table50%1/2
A
A= $USAGE_CONF->{"width"}
| |||||||||||||||||||||||||||||||||
| 19 | # Length of a tab plus 2 for the space between option & desc; | ||||||||||||||||||||||||||||||||
| 20 | 24 | my $max_length = $width - ( $_tabstop->() + $length + 2 ); | |||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | length $desc <= $max_length and return $desc; my @lines; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | while (length $desc > $max_length) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 25 | 0 | my $idx = rindex( substr( $desc, 0, $max_length ), $SPC ); | |||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | $idx >= 0 or last; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||
| 29 | 0 | push @lines, substr $desc, 0, $idx; substr( $desc, 0, 1 + $idx ) = $NUL; | |||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||
| 32 | 0 | push @lines, $desc; | |||||||||||||||||||||||||||||||
| 33 | 0 | return @lines; | |||||||||||||||||||||||||||||||
| 34 | 18 | }; | |||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | 24 | ▶ | my $_types = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=19.9
| |||||||||||||||||||||||||||||||||
| 37 | 24 | ▶ | my $k = shift; my $option_type = $USAGE_CONF->{option_type} // 'short'; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$USAGE_CONF->{"option_type"} // "short"
MC/DC0%0/1
$USAGE_CONF->{"option_type"} // "short"
$USAGE_CONF->{"option_type"}
Truth table50%1/2
A
A= $USAGE_CONF->{"option_type"}
| |||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | 24 | ▶ | $option_type eq 'none' and return; # Old behaviour | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 40 | 24 | ▶ | $option_type eq 'verbose' and return uc $k; # New behaviour | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||
| 42 | my $types = $USAGE_CONF->{type_map} | ||||||||||||||||||||||||||||||||
| 43 | 24 | ▶ | // { int => 'i', key => 'k', num => 'n', str => 's', }; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$USAGE_CONF->{"type_map"} // {"int", "i", "key", "k", "num", "n", "str", "s"}
MC/DC0%0/1
$USAGE_CONF->{"type_map"} // {"int", "i", "key", "k", "num", "n", "str", "s"}
$USAGE_CONF->{"type_map"}
Truth table50%1/2
A
A= $USAGE_CONF->{"type_map"}
| |||||||||||||||||||||||||||||||||
| 44 | 24 | ▶ | my $type = $types->{ $k } // $NUL; # Prefered behaviour | ||||||||||||||||||||||||||||||
|
Condition33%1/3
$types->{$k} // $NUL
MC/DC0%0/2
$types->{$k} // $NUL
$types->{$k}
$NUL
Truth table33%1/3
A // B
A= $types->{$k}B= $NUL
| |||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||
| 46 | 24 | return $type; | |||||||||||||||||||||||||||||||
| 47 | 18 | }; | |||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | 48 | ▶ | my $_parse_assignment = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=12 SCAR=27.4
| |||||||||||||||||||||||||||||||||
| 50 | 48 | ▶ | my $assign_spec = shift; $assign_spec or return $NUL; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | 32 | ▶ | length $assign_spec < 2 and return $NUL; # Empty, ! or + | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||
| 54 | 20 | my $argument = substr $assign_spec, 1, 2; | |||||||||||||||||||||||||||||||
| 55 | 20 | my $result = $_types->( 'str' ); | |||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||
| 57 | 20 | ▶ | if ($argument eq 'i' or $argument eq 'o') { $result = $_types->( 'int' ) } | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
$argument eq "i" or $argument eq "o"
MC/DC50%1/2
$argument eq "i" or $argument eq "o"
$argument eq "i"
$argument eq "o"
Truth table66%2/3
A or B
A= $argument eq "i"B= $argument eq "o"
| |||||||||||||||||||||||||||||||||
| 58 | 0 | elsif ($argument eq 'f') { $result = $_types->( 'num' ) } | |||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||
| 60 | 20 | ▶ | if (length $assign_spec > 2) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 61 | 4 | my $desttype = substr $assign_spec, 2, 1; | |||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||
| 63 | # Imply it can be repeated | ||||||||||||||||||||||||||||||||
| 64 | 4 | ▶ | if ($desttype eq '@') { $result .= '...' } | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 65 | elsif ($desttype eq '%') { | ||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | $result = $result ? $_types->( 'key' )."=${result}..." : $NUL; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||
| 70 | 20 | ▶ | substr $assign_spec, 0, 1 eq ':' and return "[=${result}]"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 71 | # With leading space so it can just blindly be appended. | ||||||||||||||||||||||||||||||||
| 72 | 20 | ▶ | return $result ? " $result" : $NUL; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 73 | 18 | }; | |||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||
| 75 | 24 | ▶ | my $_assemble_spec = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||
| 76 | 24 | my ($length, $spec) = @_; | |||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||
| 78 | 24 | my $stripped = [ Getopt::Long::Descriptive->_strip_assignment( $spec ) ]; | |||||||||||||||||||||||||||||||
| 79 | 24 | my $assign = $_parse_assignment->( $stripped->[ 1 ] ); | |||||||||||||||||||||||||||||||
| 80 | my $plain = join $SPC, reverse | ||||||||||||||||||||||||||||||||
| 81 | 24 | ▶ | map { length > 1 ? "--${_}${assign}" : "-${_}${assign}" } | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 82 | split m{ [|] }mx, $stripped->[ 0 ]; | ||||||||||||||||||||||||||||||||
| 83 | 24 | my $pad = $SPC x ($length - length $plain); | |||||||||||||||||||||||||||||||
| 84 | 24 | ▶ | my $highlight = $USAGE_CONF->{highlight} // 'bold'; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$USAGE_CONF->{"highlight"} // "bold"
MC/DC0%0/1
$USAGE_CONF->{"highlight"} // "bold"
$USAGE_CONF->{"highlight"}
Truth table50%1/2
A
A= $USAGE_CONF->{"highlight"}
| |||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||
| 86 | 24 | ▶ | $highlight eq 'none' and return $plain.$pad; # Old behaviour | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||
| 88 | 24 | $assign = color( $highlight ).$assign.color( 'reset' ); | |||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||
| 90 | my $markedup = join $SPC, reverse | ||||||||||||||||||||||||||||||||
| 91 | 24 | ▶ | map { length > 1 ? "--${_}${assign}" : "-${_}${assign}" } | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 92 | split m{ [|] }mx, $stripped->[ 0 ]; | ||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||
| 94 | 24 | return $markedup.$pad; # Prefered behaviour works well with short types | |||||||||||||||||||||||||||||||
| 95 | 18 | }; | |||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||
| 97 | 24 | ▶ | my $_option_length = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||
| 98 | 24 | my $fullspec = shift; | |||||||||||||||||||||||||||||||
| 99 | 24 | my $number_opts = 1; | |||||||||||||||||||||||||||||||
| 100 | 24 | my $last_pos = 0; | |||||||||||||||||||||||||||||||
| 101 | 24 | my $number_shortopts = 0; | |||||||||||||||||||||||||||||||
| 102 | 24 | my ($spec, $assign) | |||||||||||||||||||||||||||||||
| 103 | = Getopt::Long::Descriptive->_strip_assignment( $fullspec ); | ||||||||||||||||||||||||||||||||
| 104 | 24 | my $length = length $spec; | |||||||||||||||||||||||||||||||
| 105 | 24 | my $arglen = length $_parse_assignment->( $assign ); | |||||||||||||||||||||||||||||||
| 106 | # Spacing rules: | ||||||||||||||||||||||||||||||||
| 107 | # For short options we want 1 space (for '-'), for long options 2 | ||||||||||||||||||||||||||||||||
| 108 | # spaces (for '--'). Then one space for separating the options, | ||||||||||||||||||||||||||||||||
| 109 | # but we here abuse that $spec has a '|' char for that. | ||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||
| 111 | # For options that take arguments, we want 2 spaces for mandatory | ||||||||||||||||||||||||||||||||
| 112 | # options ('=X') and 4 for optional arguments ('[=X]'). Note we | ||||||||||||||||||||||||||||||||
| 113 | # consider {N,M} cases as "single argument" atm. | ||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||
| 115 | # Count the number of "variants" (e.g. "long|s" has two variants) | ||||||||||||||||||||||||||||||||
| 116 | 24 | ▶ | while ($spec =~ m{ [|] }gmx) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 117 | 2 | $number_opts++; | |||||||||||||||||||||||||||||||
| 118 | 2 | ▶ | (pos( $spec ) - $last_pos) == 2 and $number_shortopts++; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 119 | 2 | $last_pos = pos( $spec ); | |||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||
| 122 | # Was the last option a "short" one? | ||||||||||||||||||||||||||||||||
| 123 | # Getopt::Long::Descriptive has a 2 here and thats wrong | ||||||||||||||||||||||||||||||||
| 124 | 24 | ▶ | ($length - $last_pos) == 1 and $number_shortopts++; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 125 | # We got $number_opts options, each with an argument length of | ||||||||||||||||||||||||||||||||
| 126 | # $arglen. Plus each option (after the first) needs 3 a char | ||||||||||||||||||||||||||||||||
| 127 | # spacing. $length gives us the total length of all options and 1 | ||||||||||||||||||||||||||||||||
| 128 | # char spacing per option (after the first). It does not account | ||||||||||||||||||||||||||||||||
| 129 | # for argument length and we want (at least) one additional char | ||||||||||||||||||||||||||||||||
| 130 | # for space before the description. So the result should be: | ||||||||||||||||||||||||||||||||
| 131 | 24 | my $number_longopts = $number_opts - $number_shortopts; | |||||||||||||||||||||||||||||||
| 132 | 24 | my $total_arglen = $number_opts * $arglen; | |||||||||||||||||||||||||||||||
| 133 | 24 | my $total_optsep = 2 * $number_longopts + $number_shortopts; | |||||||||||||||||||||||||||||||
| 134 | 24 | my $total = $length + $total_optsep + $total_arglen; | |||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||
| 136 | 24 | return $total; | |||||||||||||||||||||||||||||||
| 137 | 18 | }; | |||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||
| 139 | # Public methods | ||||||||||||||||||||||||||||||||
| 140 | 2 | ▶ | sub option_text { | ||||||||||||||||||||||||||||||
|
Subroutine
option_text: called CC=10 SCAR=27.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 141 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||
| 142 | 2 | ▶ | my @options = @{ $self->{options} // [] }; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"options"} // []
MC/DC0%0/1
$self->{"options"} // []
$self->{"options"}
Truth table50%1/2
A
A= $self->{"options"}
| |||||||||||||||||||||||||||||||||
| 143 | 2 | my @specs = map { $_->{spec} } grep { $_->{desc} ne 'spacer' } @options; | |||||||||||||||||||||||||||||||
| 144 | 2 | ▶ | my $length = max( map { $_option_length->( $_ ) } @specs ) || 0; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
&max(map({&$_option_length($_);} @specs)) || 0
MC/DC0%0/1
&max(map({&$_option_length($_);} @specs)) || 0
&max(map({&$_option_length($_);} @specs))
Truth table50%1/2
A
A= &max(map({&$_option_length($_);} @specs))
| |||||||||||||||||||||||||||||||||
| 145 | 2 | my $tab = $SPC x $_tabstop->(); # Originally an actual tab char | |||||||||||||||||||||||||||||||
| 146 | 2 | my $spec_fmt = "${tab}%-${length}s"; | |||||||||||||||||||||||||||||||
| 147 | 2 | my $string = $NUL; | |||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||
| 149 | 2 | ▶ | while (defined (my $opt = shift @options)) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 150 | 24 | my $spec = $opt->{spec}; my $desc = $opt->{desc}; | |||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | if ($desc eq 'spacer') { $string .= sprintf "${spec_fmt}\n", $spec; next } | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||
| 154 | 24 | ▶ | if (exists $opt->{constraint}->{default} and $self->{show_defaults}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $opt->{"constraint"}{"default"} and $self->{"show_defaults"}
MC/DC0%0/2
exists $opt->{"constraint"}{"default"} and $self->{"show_defaults"}
exists $opt->{"constraint"}{"default"}
$self->{"show_defaults"}
Truth table33%1/3
A and B
A= exists $opt->{"constraint"}{"default"}B= $self->{"show_defaults"}
| |||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | my $default = $opt->{constraint}->{default} // '[undef]'; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$opt->{"constraint"}{"default"} // "[undef]"
MC/DC0%0/1
$opt->{"constraint"}{"default"} // "[undef]"
$opt->{"constraint"}{"default"}
Truth table0%0/2
A
A= $opt->{"constraint"}{"default"}
| |||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | length $default or $default = '[null]'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 158 | # Add the default to the description before splitting into lines | ||||||||||||||||||||||||||||||||
| 159 | 0 | $desc .= " (default value: ${default})"; | |||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||
| 162 | 24 | my @desc = $_split_description->( $length, $desc ); | |||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||
| 164 | 24 | $spec = $_assemble_spec->( $length, $spec ); | |||||||||||||||||||||||||||||||
| 165 | 24 | $string .= sprintf "${tab}${spec} %s\n", shift @desc; | |||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||
| 167 | 24 | for my $line (@desc) { | |||||||||||||||||||||||||||||||
| 168 | 0 | $string .= $tab.($SPC x ( $length + 2 ))."${line}\n"; | |||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||
| 172 | 2 | return $string; | |||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||
| 175 | 4 | ▶ | sub usage_conf { | ||||||||||||||||||||||||||||||
|
Subroutine
usage_conf: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||||||||||||||||||||||||
| 176 | 4 | ▶ | my ($self, $v) = @_; defined $v or return $USAGE_CONF; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||
| 178 | 4 | ▶ | ref $v eq 'HASH' or die 'Usage configuration must be a hash reference'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||
| 180 | 4 | return $USAGE_CONF = $v; | |||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||
| 183 | 18 | 1; | |||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||
| 185 | __END__ | ||||||||||||||||||||||||||||||||