Full_Name: Mike Patnode Version: openldap-2.2.26 OS: NA URL: ftp://ftp.openldap.org/incoming/ldapsearch.wrap.diffs Submission from: (NULL) (63.199.144.29) The Netscape version could optionally turn off LDIF wrap. Handy for scripting and pipes etc. I'm surprised no one has ever done this before. Is there a religious movement against it? Diffs attached for ldapsearch -r (turn off line wrap)
--On Tuesday, December 20, 2005 2:24 AM +0000 mike.patnode@centrify.com wrote: > Full_Name: Mike Patnode > Version: openldap-2.2.26 > OS: NA > URL: ftp://ftp.openldap.org/incoming/ldapsearch.wrap.diffs > Submission from: (NULL) (63.199.144.29) > > > The Netscape version could optionally turn off LDIF wrap. Handy for > scripting and pipes etc. I'm surprised no one has ever done this before. > Is there a religious movement against it? > > Diffs attached for ldapsearch -r (turn off line wrap) I'll note that 2.2 is essentially historic at this point. I suggest ensuring your diff works against the current OpenLDAP 2.3 release. --Quanah -- Quanah Gibson-Mount Principal Software Developer ITSS/Shared Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
> The Netscape version could optionally turn off LDIF wrap. Handy for > scripting > and pipes etc. I'm surprised no one has ever done this before. Is there a > religious movement against it? It's so trivial to workout otherwise that it does not deserve the coding effort. > > Diffs attached for ldapsearch -r (turn off line wrap) I suggest making the -r switch accept an optional arg that specifies the wrap column, defaulting to LDIF_LINE_WIDTH; so (nothing) means wrap at column LDIF_LINE_WIDTH -r alone means don't wrap at all -r <positive integer> means wrap at given column This should be submitted as a patch to HEAD (or at least re23) code. p. Ing. Pierangelo Masarati Responsabile Open Solution OpenLDAP Core Team SysNet s.n.c. Via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ------------------------------------------ Office: +39.02.23998309 Mobile: +39.333.4963172 Email: pierangelo.masarati@sys-net.it ------------------------------------------
changed state Open to Feedback moved from Incoming to Contrib
At 06:45 AM 12/20/2005, ando@sys-net.it wrote: >> The Netscape version could optionally turn off LDIF wrap. Handy for >> scripting >> and pipes etc. I'm surprised no one has ever done this before. Is there a >> religious movement against it? > >It's so trivial to workout otherwise that it does not deserve the coding >effort. Personally, I rather spend my time making other programs properly accepting conformant LDIF, including line wraps, than to modifying OpenLDAP Software to produce non-compliant LDIF files (note that some line wrapping is required by the open standard). >> Diffs attached for ldapsearch -r (turn off line wrap) > >I suggest making the -r switch accept an optional arg that specifies the >wrap column, defaulting to LDIF_LINE_WIDTH; so > >(nothing) means wrap at column LDIF_LINE_WIDTH > >-r alone means don't wrap at all -r 0 instead. >-r <positive integer> means wrap at given column and appropriate documentation updates please. >This should be submitted as a patch to HEAD (or at least re23) code. > >p. > > > >Ing. Pierangelo Masarati >Responsabile Open Solution >OpenLDAP Core Team > >SysNet s.n.c. >Via Dossi, 8 - 27100 Pavia - ITALIA >http://www.sys-net.it >------------------------------------------ >Office: +39.02.23998309 >Mobile: +39.333.4963172 >Email: pierangelo.masarati@sys-net.it >------------------------------------------
> -----Original Message----- > From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org] > > At 06:45 AM 12/20/2005, ando@sys-net.it wrote: > >> The Netscape version could optionally turn off LDIF wrap. > Handy for > >> scripting and pipes etc. I'm surprised no one has ever done this > >> before. Is there a religious movement against it? > > > >It's so trivial to workout otherwise that it does not deserve the > >coding effort. > > Personally, I rather spend my time making other programs > properly accepting conformant LDIF, including line wraps, > than to modifying OpenLDAP Software to produce non-compliant > LDIF files (note that some line wrapping is required by the > open standard). > OK, then why add the integer option? > >> Diffs attached for ldapsearch -r (turn off line wrap) > > > >I suggest making the -r switch accept an optional arg that specifies > >the wrap column, defaulting to LDIF_LINE_WIDTH; so > > > >(nothing) means wrap at column LDIF_LINE_WIDTH > > > >-r alone means don't wrap at all > > -r 0 instead. > > > >-r <positive integer> means wrap at given column Is -r 3 really an interesting option, or is it just code/feature bloat? Either you live in an LDIF conformant world and you want the standard wrap, or you're trying to write a one line script, and you'd rather not deal with it. Is there really an interesting in-between usage case? mp
At 04:07 PM 12/20/2005, mike.patnode@centrify.com wrote: >> -----Original Message----- >> From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org] >> >> At 06:45 AM 12/20/2005, ando@sys-net.it wrote: >> >> The Netscape version could optionally turn off LDIF wrap. >> Handy for >> >> scripting and pipes etc. I'm surprised no one has ever done this >> >> before. Is there a religious movement against it? >> > >> >It's so trivial to workout otherwise that it does not deserve the >> >coding effort. >> >> Personally, I rather spend my time making other programs >> properly accepting conformant LDIF, including line wraps, >> than to modifying OpenLDAP Software to produce non-compliant >> LDIF files (note that some line wrapping is required by the >> open standard). >> > >OK, then why add the integer option? Note that my -r 0 suggestion was in response to Ando's suggestion that ldapsearch handle -r with an optional integer. Due to getopt(3) restrictions, if there is an integer to be expected with the flag, it cannot be optional. That is, it has to be getopt(argc,argv,"r" ...) or getopt(argc,argv,"r:" ...). >> >> Diffs attached for ldapsearch -r (turn off line wrap) >> > >> >I suggest making the -r switch accept an optional arg that specifies >> >the wrap column, defaulting to LDIF_LINE_WIDTH; so >> > >> >(nothing) means wrap at column LDIF_LINE_WIDTH >> > >> >-r alone means don't wrap at all >> >> -r 0 instead. >> >> >> >-r <positive integer> means wrap at given column > >Is -r 3 really an interesting option, or is it just code/feature bloat? Some would argue that adding a no-line-wrap option to ldapsearch(1) is just code/feature bloat as, in general, any program purporting to accept LDIF input (or output of ldapsearch(1)) is generally expected to handle LDIF, including line wraps. >Either you live in an LDIF conformant world and you want the standard >wrap, or you're trying to write a one line script, and you'd rather not >deal with it. Well, if I was writing a one line script, I'd rather that script (still only one line) properly handle LDIF line wraps than to waste my time and others with getting users and programs, not just ldapsearch(1), to produce output without standard line-wraps. >Is there really an interesting in-between usage case? If a user say wants to view ldapsearch(1) output on a terminal of width 50, I would think having the capability to wrap at 50 would be useful to that user. Kurt
> -----Original Message----- > From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org] > Sent: Tuesday, December 20, 2005 5:23 PM > To: Mike Patnode > Cc: openldap-its@OpenLDAP.org > Subject: RE: (ITS#4269) ldapsearch no LDIF wrap option > > At 04:07 PM 12/20/2005, mike.patnode@centrify.com wrote: > >> -----Original Message----- > >> From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org] > >> > >> At 06:45 AM 12/20/2005, ando@sys-net.it wrote: > >> >> The Netscape version could optionally turn off LDIF wrap. > >> Handy for > >> >> scripting and pipes etc. I'm surprised no one has ever > done this > >> >> before. Is there a religious movement against it? > >> > > >> >It's so trivial to workout otherwise that it does not deserve the > >> >coding effort. > >> > >> Personally, I rather spend my time making other programs properly > >> accepting conformant LDIF, including line wraps, than to modifying > >> OpenLDAP Software to produce non-compliant LDIF files > (note that some > >> line wrapping is required by the open standard). > >> > > > >OK, then why add the integer option? > > Note that my -r 0 suggestion was in response to Ando's > suggestion that ldapsearch handle -r with an optional integer. Due to > getopt(3) restrictions, if there is an integer to be expected > with the flag, it cannot be optional. That is, it has to be > getopt(argc,argv,"r" ...) or getopt(argc,argv,"r:" ...). > > >> >> Diffs attached for ldapsearch -r (turn off line wrap) > >> > > >> >I suggest making the -r switch accept an optional arg > that specifies > >> >the wrap column, defaulting to LDIF_LINE_WIDTH; so > >> > > >> >(nothing) means wrap at column LDIF_LINE_WIDTH > >> > > >> >-r alone means don't wrap at all > >> > >> -r 0 instead. > >> > >> > >> >-r <positive integer> means wrap at given column > > > >Is -r 3 really an interesting option, or is it just > code/feature bloat? > > Some would argue that adding a no-line-wrap option to > ldapsearch(1) is just code/feature bloat as, in general, any > program purporting to accept LDIF input (or output of > ldapsearch(1)) is generally expected to handle LDIF, > including line wraps. > > >Either you live in an LDIF conformant world and you want the > standard > >wrap, or you're trying to write a one line script, and you'd > rather not > >deal with it. > > Well, if I was writing a one line script, I'd rather that > script (still only one line) properly handle LDIF line wraps > than to waste my time and others with getting users and > programs, not just ldapsearch(1), to produce output without > standard line-wraps. > > >Is there really an interesting in-between usage case? > > If a user say wants to view ldapsearch(1) output on a > terminal of width 50, I would think having the capability to > wrap at 50 would be useful to that user. Or they could just use -r, and let the terminal wrap the lines. :) Anyone ever actually ask for it? My vote would be kill it if you want to be pure, or just do the -r with no columns. mp
changed notes changed state Feedback to Closed
superseded by ITS#6645