AStyle之linux/windows脚本

资源下载:http://download.csdn.net/detail/v__king__/9814151

linux如何将AStyle集成到你的c工程

  1. 新建一个AStyle的目录
  2. 把AStyle.exe和test.sh脚本放到工程AStyle目录中,加入Makefile

shell脚本

#!/bin/bash
find ./ -name "*.c" | xargs AStyle -c --style=ansi
find ./ -name "*.h" | xargs AStyle -c --style=ansi

DOS的脚本

rem 将当前目录和所有子目录的*.c,*.h文件格式化
rem 注意历史原因dos不识别utf8编码的中文
rem 编辑dos脚本需要保存为ansi编码,
rem 可以用其他编辑器编辑,在复制到记事本中
rem add by VkingMan@20170721

@echo off

for /R "../" %%s in (,*.h) do AStyle.exe --style=ansi %%s

set /p var=删除所有的备份文件*.orig?(Y/N):

if %var% equ Y (
    echo "rm all the *.orig"
    for /R "../" %%s in (*.orig) do del %%s
)
if %var% equ y (
    echo "rm all the *.orig"
    for /R "../" %%s in (*.orig) do del %%s
)
pause

资源下载:http://download.csdn.net/detail/v__king__/9814151

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值