Skip to content

Commit

Permalink
优化提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Nov 18, 2020
1 parent 54e2227 commit 97ea54a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Usage:
Available Commands:
add 添加用户
clean 清空指定用户流量
completion 自动命令补全(支持bash和zsh)
del 删除用户
help Help about any command
Expand Down
2 changes: 1 addition & 1 deletion cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
var cleanCmd = &cobra.Command{
Use: "clean",
Short: "清空指定用户流量",
Long: `传入指定用户名来清空用户流量, 多个空格隔开, 例如:
Long: `传入指定用户名来清空用户流量, 多个用户名空格隔开, 例如:
trojan clean zhangsan lisi
`,
Args: cobra.MinimumNArgs(1),
Expand Down
2 changes: 1 addition & 1 deletion core/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

mysqlDriver "github.com/go-sql-driver/mysql"

// mysql sql驱动
"strconv"
"strings"

// mysql sql驱动
_ "github.com/go-sql-driver/mysql"
)

Expand Down
2 changes: 2 additions & 0 deletions trojan/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ func CleanDataByName(usernames []string) {
mysql := core.GetMysql()
if err := mysql.CleanDataByName(usernames); err != nil {
fmt.Println(err.Error())
} else {
fmt.Println("清空流量成功!")
}
}

Expand Down

0 comments on commit 97ea54a

Please sign in to comment.