3

I just started using astyle.

  1. Is it possible to run astyle on all the files in a folder ?
  2. If the folder has files with different formats, can it wisely choose C/C++ files alone to format ?
  3. Is it possible to link astyle to gedit so that the programs written from now on are in format ?
  4. Is it possible to not create file.cpp.orig back up file after formatting ?

Thank you!

Sai
  • 377
  • 2
  • 7
  • 18

1 Answers1

6
  1. Yes, you can do astyle *.cpp and it will run on all cpp files.
  2. See above
  3. Not to gedit, but gedit generally isn't a good program to use when coding. Most IDEs like CodeBlocks have built-in settings to help your code format automatically as you're coding.
  4. Yes it is. Run astyle with --suffix=none or -n
Unsolved Cypher
  • 1,025
  • 10
  • 24
  • For (1), assuming Sai uses source control, wouldn't it be possible to connect that to the source control system so astyle runs against the source before it gets added to the repository? – Alexis Wilke Feb 15 '15 at 21:31
  • Probably, but there actually is a way to run astyle on multiple files and I have updated my answer to reflect that. – Unsolved Cypher Feb 17 '15 at 21:12