[LDAPsh-cvs] ldapsh ldapsh,1.25,1.26
Status: Beta
Brought to you by:
rcorvalan
From: <j-d...@us...> - 2003-09-26 03:30:10
|
Update of /cvsroot/ldapsh/ldapsh In directory sc8-pr-cvs1:/tmp/cvs-serv3660 Modified Files: ldapsh Log Message: Replaced some instances of STDERR in favour of $Output->{FILEHANDLE} (including 'help all'). Index: ldapsh =================================================================== RCS file: /cvsroot/ldapsh/ldapsh/ldapsh,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ldapsh 19 Sep 2003 13:20:23 -0000 1.25 --- ldapsh 26 Sep 2003 03:29:58 -0000 1.26 *************** *** 889,893 **** } if (defined($cmd) && $cmd eq "all") { ! $parser->parse_from_file($0, \*STDERR); } else { --- 889,893 ---- } if (defined($cmd) && $cmd eq "all") { ! $parser->parse_from_file($0, $Output->{FILEHANDLE}); } else { *************** *** 945,949 **** sub version() { ! printf STDERR <<'EOF' LDAP Shell (ldapsh) by Rafael Corvalan, Peder O. Klingenberg and James Devenish. CVS File ID: %s --- 945,949 ---- sub version() { ! printf {$Output->{FILEHANDLE}} <<'EOF' LDAP Shell (ldapsh) by Rafael Corvalan, Peder O. Klingenberg and James Devenish. CVS File ID: %s *************** *** 966,970 **** foreach (keys %$Globals) { next if /^_/ or not $Globals->{$_}{RIGHTS} =~ /l/i; ! printf STDERR "\$%s = %s\n", $_, Dumper($Globals->{$_}{VALUE}); } $Data::Dumper::Terse = $oldterse; --- 966,970 ---- foreach (keys %$Globals) { next if /^_/ or not $Globals->{$_}{RIGHTS} =~ /l/i; ! printf {$Output->{FILEHANDLE}} "\$%s = %s\n", $_, Dumper($Globals->{$_}{VALUE}); } $Data::Dumper::Terse = $oldterse; *************** *** 1151,1159 **** sub id { if ($Globals->{_EFFECTIVECONNPARAMS}{VALUE}{BINDDN}) { ! printf STDERR (qq{Bound as "%s"\n}, $Globals->{_EFFECTIVECONNPARAMS}{VALUE}{BINDDN}); } elsif (defined($Globals->{_EFFECTIVECONNPARAMS}{VALUE}{BINDDN})) { ! print STDERR "Bound anonymously\n"; } else { ! print STDERR "Not bound\n"; } } --- 1151,1159 ---- sub id { if ($Globals->{_EFFECTIVECONNPARAMS}{VALUE}{BINDDN}) { ! printf {$Output->{FILEHANDLE}} (qq{Bound as "%s"\n}, $Globals->{_EFFECTIVECONNPARAMS}{VALUE}{BINDDN}); } elsif (defined($Globals->{_EFFECTIVECONNPARAMS}{VALUE}{BINDDN})) { ! print {$Output->{FILEHANDLE}} "Bound anonymously\n"; } else { ! print {$Output->{FILEHANDLE}} "Not bound\n"; } } *************** *** 1411,1415 **** sub dirs { ! print STDERR join('', map {"$_\n"} @{$Globals->{_DIRSSTACK}{VALUE}}) . "\n"; } --- 1411,1415 ---- sub dirs { ! print {$Output->{FILEHANDLE}} join('', map {"$_\n"} @{$Globals->{_DIRSSTACK}{VALUE}}) . "\n"; } *************** *** 1422,1426 **** sub pwd { ! print STDERR $Globals->{CWD}{VALUE} . "\n"; } --- 1422,1426 ---- sub pwd { ! print {$Output->{FILEHANDLE}} $Globals->{CWD}{VALUE} . "\n"; } *************** *** 1440,1444 **** return 1; } else { ! printf STDERR "$@\n"; return 0; } --- 1440,1444 ---- return 1; } else { ! printf STDERR "Cannot change directory.\n"; return 0; } *************** *** 2013,2017 **** if (defined($changes) and scalar(@$changes)) { $nbchanges++; ! printf STDERR ('=' x 40 . qq{\n%s\n}, $_->dn); my @changes = (@$changes); while(scalar(@changes)) { --- 2013,2017 ---- if (defined($changes) and scalar(@$changes)) { $nbchanges++; ! printf {$Output->{FILEHANDLE}} ('=' x 40 . qq{\n%s\n}, $_->dn); my @changes = (@$changes); while(scalar(@changes)) { *************** *** 2021,2031 **** if ($action eq 'add') { ! printf STDERR (qq{\t>>> Add attribute '%s' with values: %s\n}, $data->[0], $attributes); } elsif ($action eq 'replace') { ! printf STDERR (qq{\t>>> Replace attribute '%s' with values: %s\n}, $data->[0], $attributes); } elsif ($action eq 'delete') { ! printf STDERR (qq{\t>>> Delete attribute '%s'\n}, $data->[0]); } else { ! printf STDERR (qq{\t>>> Don't know the action '%s'\n}, $action); } } --- 2021,2031 ---- if ($action eq 'add') { ! printf {$Output->{FILEHANDLE}} (qq{\t>>> Add attribute '%s' with values: %s\n}, $data->[0], $attributes); } elsif ($action eq 'replace') { ! printf {$Output->{FILEHANDLE}} (qq{\t>>> Replace attribute '%s' with values: %s\n}, $data->[0], $attributes); } elsif ($action eq 'delete') { ! printf {$Output->{FILEHANDLE}} (qq{\t>>> Delete attribute '%s'\n}, $data->[0]); } else { ! printf {$Output->{FILEHANDLE}} (qq{\t>>> Don't know the action '%s'\n}, $action); } } *************** *** 2157,2161 **** my $nbentries = scalar(@$entries); ! print STDERR "$nbentries\n"; return $nbentries; } --- 2157,2161 ---- my $nbentries = scalar(@$entries); ! print {$Output->{FILEHANDLE}} "$nbentries\n"; return $nbentries; } *************** *** 2456,2460 **** ! # This will chech for "<ldapsh command> ;| <sheel command>" usage # If so, we do a temporary output redirection my $previous; --- 2456,2460 ---- ! # This will check for "<ldapsh command> ;| <shell command>" usage # If so, we do a temporary output redirection my $previous; |