Changeset 2401
- Timestamp:
- 06/15/20 19:10:38 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli.pm
r2400 r2401 130 130 help => 'search objecttype filter1 [filter2...] - search object according filter', 131 131 completion => sub { 132 my ($self, $ritem, $rotype) = @_; 132 133 if(!$_[2]) { 133 return $_[0]->base->list_supported_objects 134 } else { 134 return $self->base->list_supported_objects 135 } else { 136 my $parse; 137 $parse = sub { 138 my ($otype, $item) = @_; 139 $item ||= ''; 140 my ($NegFilter, $attr, $dot, $attrref, $operator, $val) = $item =~ /^([\!\+\-]?)(\w+)(?:(\.)([\.\w]+))?(?:([^\w*]+)(.+))?$/; 141 if ($dot) { 142 my $attribute = $self->base->attribute($otype, $attr) or 143 return ($self->base->list_canonical_fields( $otype, 'r' ) ); 144 my $refotype = $attribute->reference; 145 return map { "$attr." . $_ } $parse->($refotype, "$attrref$operator$val" ); 146 } else { 147 return($self->base->list_canonical_fields($otype, 'r')); 148 } 149 150 }; 135 151 return( 136 152 map { $_, "!$_", "-$_", "+$_" } 137 map { ( $_ . '=', $_ . '~' ) } $ _[0]->base->list_canonical_fields($_[2], 'r')153 map { ( $_ . '=', $_ . '~' ) } $parse->( $rotype, $ritem ) 138 154 ); 139 155 }
Note: See TracChangeset
for help on using the changeset viewer.