{ ( ? : , ; => && || ~~ !~~ =~ !~ // <=> ->
if unless and or err for foreach while until
-These alignments are all enabled by default, but they can be selectively disabled by including one or more of these tokens in the space-separated list B<valign-exclusion-list=s>. For example, the following would prevent alignment at B<=> and B<if>:
+These alignments are all enabled by default, but they can be selectively disabled by including one or more of these tokens in the space-separated list B<valign-exclusion-list=s>.
+For example, the following would prevent alignment at B<=> and B<if>:
--valign-exclusion-list='= if'
-If it is simpler to specify only the token types which are to be aligned, then use the special symbol B<*> for this exclusion list and include the types which are to be aligned in the list of B<--valign-inclusion-list> (this works because B<*> is not one of the alignment tokens). For example,
-the following parameters enable alignment only at commas and 'fat commas':
+If it is simpler to specify only the token types which are to be aligned, then
+include the types which are to be aligned in the list of B<--valign-inclusion-list>.
+You may leave the B<valign-exclusion-list> undefined, or use the special symbol B<*> for the exclusion list.
+For example, the following parameters enable alignment only at commas and 'fat commas':
- --valign-exclusion-list='*'
--valign-inclusion-list=', =>'
+ --valign-exclusion-list='*' ( this is optional and may be omitted )
These parameter lists should consist of space-separated tokens from the above
-list of possible alignment tokens. If an unrecognized parameter appears, it is
-simply ignored. And if a parameter is entered in both lists by mistake
-then the exclusion list has priority.
+list of possible alignment tokens, or a '*'. If an unrecognized token
+appears, it is simply ignored. And if a specific token is entered in both lists by
+mistake then the exclusion list has priority.
The default values of these parameters enable all alignments and are equivalent to
$co_prompt = ($color) ? 'bold green' : ''; # prompt
$co_unused = ($color) ? 'on_green' : 'reverse'; # unused
-To exclude all alignments except the equals we could use:
+To exclude all alignments except the equals (i.e., include only equals) we could use:
- # perltidy -vxl='*' -vil='='
+ # perltidy -vil='='
$co_description = ($color) ? 'bold cyan' : ''; # description
$co_prompt = ($color) ? 'bold green' : ''; # prompt
$co_unused = ($color) ? 'on_green' : 'reverse'; # unused
%valign_control_hash = ();
$valign_control_default = 1;
+ # If -vil=s is entered without -vxl, assume -vxl='*'
+ if ( !$rOpts->{'valign-exclusion-list'}
+ && $rOpts->{'valign-inclusion-list'} )
+ {
+ $rOpts->{'valign-exclusion-list'} = '*';
+ }
+
# See if the user wants to exclude any alignment types ...
if ( $rOpts->{'valign-exclusion-list'} ) {