Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF-Simple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CommunityXG
OpenXG-AMF-Simple
Commits
4c381185
Commit
4c381185
authored
Feb 22, 2021
by
Keliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add code_format.sh
parent
cc3df3b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
code_format.sh
code_format.sh
+64
-0
No files found.
code_format.sh
0 → 100755
View file @
4c381185
#!/bin/bash
#**************************************
License_name
=
"/home/root1/desktop/license.txt"
paper
=
1
str
=
'\n'
#**************************************
until
[
-z
"
$1
"
]
do
case
"
$1
"
in
-p
|
--file-path-name
)
echo
"waiting......."
filelist
=
`
find
$2
-iname
"*.cpp"
-o
-iname
"*.hpp"
-o
-iname
"*.c"
-o
-iname
"*.h"
`
for
filename
in
$filelist
;
do
if
grep
-q
"OpenAirInterface"
$filename
then
echo
"There's already license in
$filename
"
else
paper
=
1
cat
$License_name
|while
read
LINE
do
if
[
-z
"
$LINE
"
]
then
sed
-i
"
${
paper
}
i
\\
$str
"
$filename
else
sed
-i
"
${
paper
}
i
\\
$LINE
"
$filename
fi
paper
=
`
expr
$paper
+ 1
`
done
echo
"add license successfully to
$filename
"
fi
clang-format
-style
=
Google
-i
$filename
done
echo
"clang-format and add license successfully"
break
;;
-f
|
--file-name
)
echo
"file name is
$2
"
if
grep
-q
"OpenAirInterface"
$2
then
echo
"There's already license in
$2
"
else
cat
$License_name
|while
read
LINE
do
if
[
-z
"
$LINE
"
]
then
sed
-i
"
${
paper
}
i
\\
$str
"
$2
else
sed
-i
"
${
paper
}
i
\\
$LINE
"
$2
fi
paper
=
`
expr
$paper
+ 1
`
done
echo
"add license successfully to
$2
"
fi
clang-format
-style
=
Google
-i
$2
echo
"clang-format and add license successfully"
break
;;
*
)
echo
"unknown option
$1
"
break
;;
esac
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment