Skip to content

Commit b60405e

Browse files
committed
code shorten in inspect module
1 parent 5b5b168 commit b60405e

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

src/inspect.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,27 @@ source "${Dir}"/os.sh
1919
# cols (int) > takes columns as arg.
2020
# lines (int) > takes lines as arg.
2121
inspect.ScreenSize(){
22-
# local ARGCols=101;
2322
local ARGCols="${1}";
24-
# local ARGRou=39;
2523
local ARGRou="${2}";
26-
# current columns in terminal.
27-
if ! screen.isSize "${ARGCols}" "${ARGRou}"; then
24+
screen.isSize "${ARGCols}" "${ARGRou}" || {
2825
say.warn "Your Screen Size\n
2926
\t\tColumns: '$(screen.cols)'\n
30-
\t\tLines: '$(screen.lines)'
31-
";
27+
\t\tLines: '$(screen.lines)'";
3228
say.success "Require Screen Size\n
3329
\t\tColumns: '${ARGCols}'\n
34-
\t\tLines: '${ARGRou}'
35-
";
30+
\t\tLines: '${ARGRou}'";
3631
say.error "Please 'ZoomOut' your Terminal\n
3732
\t\tThen run again.";
3833
exit 1;
39-
else
40-
return 0;
41-
fi
34+
};
4235
}
4336

4437
# inspect.is_func(function) -> str
4538
# An extension of os.is_func.
4639
inspect.is_func(){
47-
if ! os.is_func "${1}"; then
40+
os.is_func "${1}" || {
4841
say.error "There is no '${1}'\n
4942
\t\tShould to install it on your OS.";
5043
exit 1;
51-
fi
52-
}
44+
};
45+
}

0 commit comments

Comments
 (0)