documented nimfix

This commit is contained in:
Araq
2014-11-04 08:38:56 +01:00
parent 0a2296b123
commit 1f63d1c76e
7 changed files with 79 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ import options, commands, modules, sem, passes, passaux, pretty, msgs, nimconf,
const Usage = """
Nimfix - Tool to patch Nim code
Usage:
nimfix [options] projectflie.nim
nimfix [options] projectfile.nim
Options:
--overwriteFiles:on|off overwrite the original nim files.

56
doc/nimfix.txt Normal file
View File

@@ -0,0 +1,56 @@
=====================
Nimfix User Guide
=====================
:Author: Andreas Rumpf
:Version: |nimversion|
**WARNING**: Nimfix is currently beta-quality.
Nimfix is a tool to help you upgrade from Nimrod (<= version 0.9.6) to
Nim (=> version 0.10.0).
It performs 3 different actions:
1. It makes your code case consistent.
2. It renames every symbol that has a deprecation rule. So if a module has a
rule ``{.deprecated: [TFoo: Foo].}`` then ``TFoo`` is replaced by ``Foo``.
3. It can also check that your identifiers adhere to the official style guide
and optionally modify them to do so (via ``--styleCheck:auto``).
Note that ``nimfix`` defaults to **overwrite** your code unless you
use ``--overwriteFiles:off``! But hey, if you do not use a version control
system by this day and age, your project is already in big trouble.
Installation
------------
Nimfix is part of the compiler distribution. Compile via::
nim c compiler/nimfix/nimfix.nim
mv compiler/nimfix/nimfix bin
Or on windows::
nim c compiler\nimfix\nimfix.nim
move compiler\nimfix\nimfix.exe bin
Usage
-----
Usage:
nimfix [options] projectfile.nim
Options:
--overwriteFiles:on|off overwrite the original nim files. DEFAULT is ON!
--wholeProject overwrite every processed file.
--checkExtern:on|off style check also extern names
--styleCheck:on|off|auto performs style checking for identifiers
and suggests an alternative spelling;
'auto' corrects the spelling.
In addition, all command line options of Nim are supported.

View File

@@ -18,3 +18,7 @@ The standard distribution ships with the following tools:
- | `estp <estp.html>`_
| Nim's slow platform independent embedded stack trace profiler.
- | `nimfix <nimfix.html>`_
| Nimfix is a tool to help you upgrade from Nimrod (<= version 0.9.6) to
Nim (=> version 0.10.0).

View File

@@ -9,25 +9,25 @@ should be in your ``$PATH`` (most likely the case). Note that some few Linux
distributions do not ship with a GCC compiler preinstalled - then you have to
install it.
Install Nimrod by downloading the appropriate ``.zip`` file and extracting it
to a directory of your choice. The Nimrod Compiler will stay in this
Install Nim by downloading the appropriate ``.zip`` file and extracting it
to a directory of your choice. The Nim Compiler will stay in this
directory (unless you copy it somewhere else). The compiler does not need
write access to its directory, so copying the nimrod folder to ``/opt``
write access to its directory, so copying the nim folder to ``/opt``
works.
Then run the following command::
sh build.sh
Unlike other software, Nimrod does not distribute its files over the whole file
Unlike other software, Nim does not distribute its files over the whole file
hierarchy. This has the advantage that you can deinstall it by just deleting
its folder. The disadvantage is that you have to add it to your ``PATH``
manually. An alternative is to create a symbolic link in ``/usr/bin``::
[sudo] ln -s $your_install_dir/bin/nimrod /usr/bin/nimrod
[sudo] ln -s $your_install_dir/bin/nim /usr/bin/nim
There are also ``install.sh`` and ``deinstall.sh`` scripts for distributing
the files over the UNIX hierarchy. However, updating your Nimrod installation
the files over the UNIX hierarchy. However, updating your Nim installation
is more cumbersome then.
@@ -43,9 +43,9 @@ You need to install Apple's developer's tools for the GNU Compiler Collection.
Installation on Windows
-----------------------
Install Nimrod by downloading and running the ``nimrod_$version.exe`` file.
Install Nim by downloading and running the ``nim_$version.exe`` file.
As default, the ``GCC`` compiler is used that is bundled with this installer.
You can change the configuration file ``config/nimrod.cfg`` to use
You can change the configuration file ``config/nim.cfg`` to use
another C compiler or change the path to GCC.
Currently, the following C compilers are supported under Windows:
@@ -64,5 +64,5 @@ However, most testing is done with GCC.
Bootstrapping from Github
-------------------------
Take a look at the readme file on github `here <https://github.com/Araq/Nimrod#readme>`_
Take a look at the readme file on github `here <https://github.com/Araq/Nim#readme>`_
for instructions.

View File

@@ -1,10 +1,11 @@
version 0.10
============
- Declare nimfix as beta-quality.
- fix deepCopy bug in parallel section
- fix missing GC_ref bug for flow variables
- implement 'static_call'
- make nimble part of the distribution
- fix babelpackagelist bug
version 0.9.6
=============

View File

@@ -21,9 +21,9 @@ News
without 'else' are deprecated.
- Recursive tuple types are not allowed anymore. Use ``object`` instead.
- The PEGS module returns ``nil`` instead of ``""`` when an optional capture
fails to match
fails to match.
- The re module returns ``nil`` instead of ``""`` when an optional capture
fails to match
fails to match.
Language Additions
------------------
@@ -55,7 +55,9 @@ News
- Two backticks now produce a single backtick within an ``emit`` or ``asm``
statement.
- There is a new tool, `nimfix <nimfix.html>`_ to help you in updating your
code from Nimrod to Nim.
Library Additions
-----------------

View File

@@ -39,6 +39,7 @@ UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson."""
[Documentation]
doc: "endb;intern;apis;lib;manual.txt;tut1;tut2;nimc;overview;filters"
doc: "tools;niminst;nimgrep;gc;estp;idetools;docgen;koch;backends.txt"
doc: "nimfix.txt"
pdf: "manual;lib;tut1;tut2;nimc;niminst;gc"
srcdoc2: "system.nim"
srcdoc2: "core/macros;pure/marshal;core/typeinfo;core/unsigned"