Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
Update snippets to our team coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
Janfy committed Jul 21, 2017
1 parent 9a7f3b0 commit 0ae3731
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions getopts.sublime-snippet
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ while getopts :${1:?}a-:fqvh arg
do
case \$arg in
-)
if [[ \${!OPTIND} == -* ]]
then
value=
if [[ \${!OPTIND} == -* ]]; then
unset -v value
else
value="\${!OPTIND}"
((OPTIND++))
Expand All @@ -18,8 +17,7 @@ do
;;
port)
if [[ ! \$value =~ ^[0-9]+\$ ]]
then
if [[ ! \$value =~ ^[0-9]+\$ ]]; then
print_error "L'option --\$OPTARG a besoin d'un entier en parametre. \"\$value\" n'est pas un entier."
usage
exit 2
Expand Down
3 changes: 1 addition & 2 deletions while_read_file.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<snippet>
<content><![CDATA[
while read -r line
do
while read -r line; do
echo "\$line"
done < ${1:/path/to/file}
]]></content>
Expand Down

0 comments on commit 0ae3731

Please sign in to comment.