From 1136d961a0875e271932d6ac331aeb8d2683577f Mon Sep 17 00:00:00 2001 From: Peter Vingelmann Date: Sat, 24 Sep 2016 03:15:59 +0200 Subject: [PATCH] Update README.rst --- README.rst | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2783622..27a144f 100644 --- a/README.rst +++ b/README.rst @@ -60,4 +60,31 @@ recursive search (``-R``) option:: path/to/astyle -Q -R *.cpp *.hpp *.c *.h --print-changes With the ``-Q`` option, astyle will only display information about the -formatted files (it will not list the unchanged files). \ No newline at end of file +formatted files (it will not list the unchanged files). + +Instead of copying ``.astylerc`` to your home folder, you can also specify +the options file directly. The file can change in the future, so this is the +recommended solution if you want to invoke astyle from your IDE:: + + cd my-project + path/to/astyle --options=/path/to/.astylerc -Q -R *.cpp *.hpp *.c *.h --print-changes + +Running astyle with fabric (for Steinwurf projects) +--------------------------------------------------- + +For convenience, we also have fabric tasks to run astyle on Steinwurf projects. + +The ``astyle.format_code`` task will format all C/C++ source files in the +selected project:: + + fab astyle.format_code:my-project + +You can also add ``update_astyle=True`` to automatically update the astyle +project and build the latest binary:: + + fab astyle.format_code:my-project,update_astyle=True + +The ``astyle.check_code`` task will not make any changes in the C/C++ source +files, it will only print the required changes in the selected project:: + + fab astyle.check_code:my-project