swig/Tools/convertpath
William S Fulton 2347e87451 CSharp test-suite support on windows
- Add pathconvert tool to convert to a windows path for input files for
  C# compiler
- Simplify vcfilter
2015-04-04 02:17:56 +01:00

27 lines
610 B
Bash
Executable file

#!/bin/sh
# Unix to Windows relative path conversion in a script.
# Useful for avoiding backslash quoting difficulties in Makefiles.
# Acts as a much dumbed down 'cygpath -w' tool.
usage()
{
cat <<EOF
Usage: $0 [-w|-u|-h] [path]...
Convert Windows and Unix paths (intended for simple relative paths only)
-w Convert backslashes to forward slashes in the paths
-u Convert forward slashes to backslashes in the paths
EOF
}
option="$1"
case "$option" in
-w) shift; echo $@ | sed -e 's,/,\\,g' ;;
-u) shift; echo $@ | sed -e 's,\\,/,g' ;;
-h) shift; usage; ;;
*) usage; exit 1 ;;
esac
exit 0