Skip to content

Commit 541ed97

Browse files
authored
Merge pull request conan-io#596 from aallrd/docs-tooling-unix2dos
New unix2dos and dos2unix tool conan-io#2605
2 parents e1bec6e + a621d97 commit 541ed97

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

‎reference/tools.rst‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,42 @@ This tool also looks for filenames with following extensions if no extension pro
932932
Parameters:
933933
- **filename** (Required): Name of the executable file. It doesn't require the extension of the executable.
934934

935+
tools.unix2dos()
936+
----------------
937+
938+
.. code-block:: python
939+
940+
def unix2dos(filepath)
941+
942+
Converts line breaks in a text file from Unix format (LF) to DOS format (CRLF).
943+
944+
.. code-block:: python
945+
946+
from conans import tools
947+
948+
tools.unix2dos("project.dsp")
949+
950+
Parameters:
951+
- **filepath** (Required): The file to convert.
952+
953+
tools.dos2unix()
954+
----------------
955+
956+
.. code-block:: python
957+
958+
def dos2unix(filepath)
959+
960+
Converts line breaks in a text file from DOS format (CRLF) to Unix format (LF).
961+
962+
.. code-block:: python
963+
964+
from conans import tools
965+
966+
tools.dos2unix("dosfile.txt")
967+
968+
Parameters:
969+
- **filepath** (Required): The file to convert.
970+
935971
tools.touch()
936972
-------------
937973

0 commit comments

Comments
 (0)