-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqck
49 lines (46 loc) · 1.08 KB
/
qck
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
###################################################################################
# This file is part of qc, providing intelligent qc help check
#
# Latest version: <https://github.com/reidliu41/qc>
#
# Copyright : Copyright (c) 2022 Reid Liu <[email protected]>
###################################################################################
FIRST_ARG=$1
filter_help_output(){
FILTER_ARG=$1
LINE_COUNT=$2
quick_cd_sosdir.sh -h|grep $FILTER_ARG -A $LINE_COUNT
}
if [ $# -eq 0 ]
then
echo "===============================================
To search the keyword from qc -h output quickly
Usage: qck keyword
e.g. qck systemd
Options:
opt options
scmd sos_commands path
log var log path
etc etc path
keyword qc -h|grep keyword
==============================================="
exit
fi
case "$FIRST_ARG" in
opt)
filter_help_output Options: 11
;;
scmd)
filter_help_output sos_commands: 96
;;
log)
filter_help_output logs: 19
;;
etc)
filter_help_output etc: 29
;;
*)
quick_cd_sosdir.sh -h|grep $FIRST_ARG
;;
esac