Skip to content

Commit 464fddb

Browse files
committed
added comments
1 parent 0595d64 commit 464fddb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

mini-matrix.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Author : SkwalExe
33
# Github : https://github.com/SkwalExe
44

5-
command="matrix"
5+
command="matrix" # the command to execute
66

77
# settings
88
loop="true"
9-
speed="0.5"
9+
speed="0.5" # delay between each lines
1010
n_chars=10 # number of characters in each line
1111
custom_chars="01"
1212

@@ -26,12 +26,12 @@ while [ $# -gt 0 ]; do
2626
;;
2727

2828
-s|--speed)
29-
if [ $# -gt 1 ]; then
30-
if [ $(echo "$2" | grep -E "^[0-9]+$") ]; then
29+
if [ $# -gt 1 ]; then # if one argument is specified after --speed
30+
if [ $(echo "$2" | grep -E "^[0-9]+$") ]; then # if the arg is a number
3131
speed=$2
3232
shift 2
3333
elif
34-
[ $(echo "$2" | grep -E "^[0-9]+\.[0-9]+$") ];
34+
[ $(echo "$2" | grep -E "^[0-9]+\.[0-9]+$") ]; # if the arg is a float
3535
then
3636
speed=$2
3737
shift 2
@@ -48,8 +48,8 @@ while [ $# -gt 0 ]; do
4848

4949
-l|--loop)
5050

51-
if [ $# -gt 1 ]; then
52-
if [ $(echo "$2" | grep -E "^(true|false)$") ]; then
51+
if [ $# -gt 1 ]; then # if there is one argument after --loop
52+
if [ $(echo "$2" | grep -E "^(true|false)$") ]; then # if the arg is true or false
5353
loop=$2
5454
shift 2
5555
else
@@ -65,8 +65,8 @@ while [ $# -gt 0 ]; do
6565

6666
-c|--chars)
6767

68-
if [ $# -gt 1 ]; then
69-
if [ $(echo "$2" | grep -E "^[0-9]+$") ]; then
68+
if [ $# -gt 1 ]; then # if there is one argument after --chars
69+
if [ $(echo "$2" | grep -E "^[0-9]+$") ]; then # if the arg is a number
7070
n_chars=$2
7171
shift 2
7272
else
@@ -83,7 +83,7 @@ while [ $# -gt 0 ]; do
8383

8484
-a|--custom-chars)
8585

86-
if [ $# -gt 1 ]; then
86+
if [ $# -gt 1 ]; then # if there is one argument after --custom-chars
8787
custom_chars=$2
8888
shift 2
8989

0 commit comments

Comments
 (0)