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] |
On 4/20/2016 7:14 PM, Ernie Rael wrote:
On 4/20/2016 1:37 PM, Eliot Moss wrote:I think this will do it: function git { declare -a ARGS for n in "$@" ; do ARGS+=("$(cygpath -u -- "${n}")") ; done command git "${ARGS[@]}" } The reason this is a little more complicated than some other approaches might be is that it will also work for arguments that have space, e.g., git add "C:/My Documents/foo.doc"Notice that IFS=$'\n'; args=($(cygpath -m -- "$@")); IFS=$' \t\n' also handles arguments with spaces. You don't need the shell for loop.
Ok ... but I would save the previous value of IFS and restore it -- never know what a user might be using there ... Best -- E -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |