This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Little cygpath improvement request


On Feb 16 18:41, Andrey Repin wrote:
> Greetings, Corinna Vinschen!
> 
> >> >> >> I would like to request a small functional change for cygpath.
> >> >> >> In the event of empty given path argument (i.e. `cygpath -ml ""') silently
> >> >> >> return an empty result without error message.
> >> >> >> This would greatly simplify wrapper scripts.
> >> >> 
> >> >> > Why isn't redirecting the message to /dev/null not sufficient, something
> >> >> > like this (bash syntax)?
> >> >> 
> >> >> Because it'll require creating a redirection? And this kind of redundant
> >> >> inserts blurring the code.
> >> >> Returning a non-zero exit code would suffice for debugging purposes.
> >> >> 
> >> >> > cygpath -ml ""  >/dev/null 2&>1
> >> >> 
> >> >> Err, not > /dev/null !!! :D
> >> 
> >> >   dos_path=$( [ -n "${posix_path}" ] && cygpath -ml "${posix_path}" )
> >> 
> >> > ?
> >> 
> >> I appreciate the effort, bit this even MORE complicating the possible use
> >> case.
> >> 
> >> Look, I'm asking for simplification without loosing functionality.
> >> If I NEED to check the path for existence, I would write something to the
> >> extent of
> 
> > I'm getting a bit puzzled.  If it's only the message you don't want,
> > then why not just send this message to /dev/null???
> 
> Because the message serves no purpose in every use case I could think about.
> That, aside the fact it needs to create a redirection.
> 
> >   NATIVE=$(cygpath -ml "$2" 2>/dev/null)

And what's the problem with redirections?

I fail to see the big difference between adding a redirection
compared to adding an option character.


Corinna


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpmH_eIT9vY5.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]