Skip to content

Commit bebea42

Browse files
committed
Upd: Update docs, detals
1 parent 682880d commit bebea42

File tree

28 files changed

+205
-203
lines changed

28 files changed

+205
-203
lines changed

README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ Currently, the project only maintains the `master` branch for releasing stable v
3131

3232
## TODO list
3333

34-
Rankings do not differentiate priority levels.
34+
Rankings do not differentiate priority levels. Delete the corresponding entry after completion of the following content.
3535

3636
1. File transfer supports wildcards
3737
2. Completing unit test code
3838
3. Security-related features, such as encrypting configuration files, hiding sensitive information from plain text display, and switching to interactive password input
39-
4. Support for key-based authentication
4039

4140
## Quick Start
4241

@@ -76,9 +75,9 @@ Usage:
7675
7776
Available Commands:
7877
alias Set, unset, and list aliases, aliases can be used to log in to servers
79-
create Create alternate username, port number, password, and login cache information
80-
delete Delete alternate username, port number, password, and login cache information
81-
get Get alternate username, port number, password, and login cache information
78+
create Create alternative username, port number, password, and login cache information
79+
delete Delete alternative username, port number, password, and login cache information
80+
get Get alternative username, port number, password, and login cache information
8281
help Help about any command
8382
prune Check if all current caches are available and clear the ones that are not available
8483
scp Upload/Download file to/from the server through SSH protocol
@@ -99,16 +98,17 @@ The `"create"` command of `tryssh` is used to create various configurations for
9998

10099
```
101100
$ tryssh create -h
102-
Create alternate username, port number, password, and login cache information
101+
Create alternative username, port number, password, and login cache information
103102
104103
Usage:
105104
tryssh create [command]
106105
107106
Available Commands:
108-
caches Create a alternate cache
109-
passwords Create a alternate password
110-
ports Create a alternate port
111-
users Create a alternate username
107+
caches Create an alternative cache
108+
keys Create a alternative key file path
109+
passwords Create an alternative password
110+
ports Create an alternative port
111+
users Create an alternative username
112112
113113
Flags:
114114
-h, --help help for create
@@ -137,16 +137,17 @@ The `"delete"` command of `tryssh` is used to delete various configurations for
137137

138138
```
139139
$ tryssh delete -h
140-
Delete alternate username, port number, password, and login cache information
140+
Delete alternative username, port number, password, and login cache information
141141
142142
Usage:
143143
tryssh delete [command]
144144
145145
Available Commands:
146-
caches Delete a alternate cache
147-
passwords Delete a alternate password
148-
ports Delete a alternate port
149-
users Delete a alternate username
146+
caches Delete an alternative cache
147+
keys Delete a alternative key file path
148+
passwords Delete an alternative password
149+
ports Delete an alternative port
150+
users Delete an alternative username
150151
151152
Flags:
152153
-h, --help help for delete
@@ -178,16 +179,16 @@ The `"get"` command of `tryssh` is used to view various configurations for passw
178179

179180
```
180181
$ tryssh get -h
181-
Get alternate username, port number, password, and login cache information
182+
Get alternative username, port number, password, and login cache information
182183
183184
Usage:
184185
tryssh get [command]
185186
186187
Available Commands:
187-
caches Get alternate caches by ipAddress
188-
passwords Get alternate passwords
189-
ports Get alternate ports
190-
users Get alternate usernames
188+
caches Get alternative caches by ipAddress
189+
passwords Get alternative passwords
190+
ports Get alternative ports
191+
users Get alternative usernames
191192
192193
Flags:
193194
-h, --help help for get

README_zh.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@
3131

3232
## 待做清单
3333

34-
排名不区分优先级
34+
排名不区分优先级,以下内容在完成后删除对应条目
3535

3636
1. 传输文件支持通配符
3737
2. 完成单元测试代码
3838
3. 安全相关功能,配置文件加密、隐藏明文显示的敏感信息、密码输入应改为交互式等
39-
4. 支持秘钥登陆
4039

4140
## 快速开始
4241

@@ -76,9 +75,9 @@ Usage:
7675
7776
Available Commands:
7877
alias Set, unset, and list aliases, aliases can be used to log in to servers
79-
create Create alternate username, port number, password, and login cache information
80-
delete Delete alternate username, port number, password, and login cache information
81-
get Get alternate username, port number, password, and login cache information
78+
create Create alternative username, port number, password, and login cache information
79+
delete Delete alternative username, port number, password, and login cache information
80+
get Get alternative username, port number, password, and login cache information
8281
help Help about any command
8382
prune Check if all current caches are available and clear the ones that are not available
8483
scp Upload/Download file to/from the server through SSH protocol
@@ -98,16 +97,17 @@ tryssh 的`create`命令用于创建用来猜密码登陆的各类配置,比
9897
#### create 帮助信息
9998
```
10099
$ tryssh create -h
101-
Create alternate username, port number, password, and login cache information
100+
Create alternative username, port number, password, and login cache information
102101
103102
Usage:
104103
tryssh create [command]
105104
106105
Available Commands:
107-
caches Create a alternate cache
108-
passwords Create a alternate password
109-
ports Create a alternate port
110-
users Create a alternate username
106+
caches Create an alternative cache
107+
keys Create a alternative key file path
108+
passwords Create an alternative password
109+
ports Create an alternative port
110+
users Create an alternative username
111111
112112
Flags:
113113
-h, --help help for create
@@ -136,16 +136,16 @@ tryssh 的`delete`命令用于删除用来猜密码登陆的各类配置,比
136136

137137
```
138138
$ tryssh delete -h
139-
Delete alternate username, port number, password, and login cache information
139+
Delete alternative username, port number, password, and login cache information
140140
141141
Usage:
142142
tryssh delete [command]
143143
144144
Available Commands:
145-
caches Delete a alternate cache
146-
passwords Delete a alternate password
147-
ports Delete a alternate port
148-
users Delete a alternate username
145+
caches Delete an alternative cache
146+
passwords Delete an alternative password
147+
ports Delete an alternative port
148+
users Delete an alternative username
149149
150150
Flags:
151151
-h, --help help for delete
@@ -177,16 +177,17 @@ tryssh 的`get`命令用于查看用来猜密码登陆的各类配置,比如
177177

178178
```
179179
$ tryssh get -h
180-
Get alternate username, port number, password, and login cache information
180+
Get alternative username, port number, password, and login cache information
181181
182182
Usage:
183183
tryssh get [command]
184184
185185
Available Commands:
186-
caches Get alternate caches by ipAddress
187-
passwords Get alternate passwords
188-
ports Get alternate ports
189-
users Get alternate usernames
186+
caches Get alternative caches by ipAddress
187+
keys Delete a alternative key file path
188+
passwords Get alternative passwords
189+
ports Get alternative ports
190+
users Get alternative usernames
190191
191192
Flags:
192193
-h, --help help for get

cmd/alias/alias.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import (
55
)
66

77
func NewAliasCommand() *cobra.Command {
8-
aliasCmd := &cobra.Command{
8+
cmd := &cobra.Command{
99
Use: "alias <subCommand> [flags]",
1010
Short: "Set, unset, and list aliases, aliases can be used to log in to servers",
1111
Long: "Set, unset, and list aliases, aliases can be used to log in to servers",
1212
}
13-
aliasCmd.AddCommand(NewAliasListCommand())
14-
aliasCmd.AddCommand(NewAliasSetCommand())
15-
aliasCmd.AddCommand(NewAliasUnsetCommand())
16-
return aliasCmd
13+
cmd.AddCommand(NewAliasListCommand())
14+
cmd.AddCommand(NewAliasSetCommand())
15+
cmd.AddCommand(NewAliasUnsetCommand())
16+
return cmd
1717
}

cmd/alias/list.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import (
77
)
88

99
func NewAliasListCommand() *cobra.Command {
10-
aliasListCmd := &cobra.Command{
10+
cmd := &cobra.Command{
1111
Use: "list",
1212
Short: "List all alias",
1313
Long: "List all alias",
1414
Aliases: []string{"ls"},
1515
Run: func(cmd *cobra.Command, args []string) {
1616
configuration := config.LoadConfig()
17-
aliasController := control.NewAliasController("", configuration, "")
18-
aliasController.ListAlias()
17+
controller := control.NewAliasController("", configuration, "")
18+
controller.ListAlias()
1919
},
2020
}
21-
return aliasListCmd
21+
return cmd
2222
}

cmd/alias/set.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
func NewAliasSetCommand() *cobra.Command {
10-
aliasSetCmd := &cobra.Command{
10+
cmd := &cobra.Command{
1111
Use: "set <alias> [flags]",
1212
Args: cobra.ExactArgs(1),
1313
Short: "Set an alias for the specified server address",
@@ -16,15 +16,15 @@ func NewAliasSetCommand() *cobra.Command {
1616
aliasContent := args[0]
1717
targetAddress, _ := cmd.Flags().GetString("target")
1818
configuration := config.LoadConfig()
19-
aliasController := control.NewAliasController(targetAddress, configuration, aliasContent)
20-
aliasController.SetAlias()
19+
controller := control.NewAliasController(targetAddress, configuration, aliasContent)
20+
controller.SetAlias()
2121
},
2222
}
23-
aliasSetCmd.Flags().StringP(
23+
cmd.Flags().StringP(
2424
"target", "t", "", "Set the alias for the target server address")
25-
err := aliasSetCmd.MarkFlagRequired("target")
25+
err := cmd.MarkFlagRequired("target")
2626
if err != nil {
2727
return nil
2828
}
29-
return aliasSetCmd
29+
return cmd
3030
}

cmd/alias/unset.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ import (
77
)
88

99
func NewAliasUnsetCommand() *cobra.Command {
10-
aliasUnsetCmd := &cobra.Command{
10+
cmd := &cobra.Command{
1111
Use: "unset <alias>",
1212
Args: cobra.ExactArgs(1),
1313
Short: "Unset the alias",
1414
Long: "Unset the alias",
1515
Run: func(cmd *cobra.Command, args []string) {
1616
aliasContent := args[0]
1717
configuration := config.LoadConfig()
18-
aliasController := control.NewAliasController("", configuration, aliasContent)
19-
aliasController.UnsetAlias()
18+
controller := control.NewAliasController("", configuration, aliasContent)
19+
controller.UnsetAlias()
2020
},
2121
}
22-
return aliasUnsetCmd
22+
return cmd
2323
}

cmd/create/caches.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99
)
1010

1111
func NewCachesCommand() *cobra.Command {
12-
cachesCmd := &cobra.Command{
12+
cmd := &cobra.Command{
1313
Use: "caches <cache>",
14-
Short: "Create a alternate cache",
15-
Long: "Create a alternate cache",
14+
Short: "Create an alternative cache",
15+
Long: "Create an alternative cache",
1616
Aliases: []string{"cache"},
1717
Run: func(cmd *cobra.Command, args []string) {
1818
newIp, _ := cmd.Flags().GetString("ip")
@@ -33,31 +33,31 @@ func NewCachesCommand() *cobra.Command {
3333
return
3434
}
3535
configuration := config.LoadConfig()
36-
createCtl := control.NewCreateController(control.TypeCaches, string(contentJson), configuration)
37-
createCtl.ExecuteCreate()
36+
controller := control.NewCreateController(control.TypeCaches, string(contentJson), configuration)
37+
controller.ExecuteCreate()
3838
},
3939
}
40-
cachesCmd.Flags().StringP("ip", "i", "", "The ipaddress of the cache to be added")
41-
cachesCmd.Flags().StringP("user", "u", "", "The username of the cache to be added")
42-
cachesCmd.Flags().StringP("port", "P", "", "The port of the cache to be added")
43-
cachesCmd.Flags().StringP("pwd", "p", "", "The password of the cache to be added")
44-
cachesCmd.Flags().StringP("alias", "a", "", "The alias of the cache to be added")
40+
cmd.Flags().StringP("ip", "i", "", "The ipaddress of the cache to be added")
41+
cmd.Flags().StringP("user", "u", "", "The username of the cache to be added")
42+
cmd.Flags().StringP("port", "P", "", "The port of the cache to be added")
43+
cmd.Flags().StringP("pwd", "p", "", "The password of the cache to be added")
44+
cmd.Flags().StringP("alias", "a", "", "The alias of the cache to be added")
4545

46-
if err := cachesCmd.MarkFlagRequired("ip"); err != nil {
46+
if err := cmd.MarkFlagRequired("ip"); err != nil {
4747
utils.Logger.Errorln("Flag: ip must be set.")
4848
return nil
4949
}
50-
if err := cachesCmd.MarkFlagRequired("user"); err != nil {
50+
if err := cmd.MarkFlagRequired("user"); err != nil {
5151
utils.Logger.Errorln("Flag: user must be set.")
5252
return nil
5353
}
54-
if err := cachesCmd.MarkFlagRequired("port"); err != nil {
54+
if err := cmd.MarkFlagRequired("port"); err != nil {
5555
utils.Logger.Errorln("Flag: port must be set.")
5656
return nil
5757
}
58-
if err := cachesCmd.MarkFlagRequired("pwd"); err != nil {
58+
if err := cmd.MarkFlagRequired("pwd"); err != nil {
5959
utils.Logger.Errorln("Flag: password must be set.")
6060
return nil
6161
}
62-
return cachesCmd
62+
return cmd
6363
}

cmd/create/create.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import (
55
)
66

77
func NewCreateCommand() *cobra.Command {
8-
createCmd := &cobra.Command{
8+
cmd := &cobra.Command{
99
Use: "create [command]",
10-
Short: "Create alternate username, port number, password, and login cache information",
11-
Long: "Create alternate username, port number, password, and login cache information",
10+
Short: "Create alternative username, port number, password, and login cache information",
11+
Long: "Create alternative username, port number, password, and login cache information",
1212
Aliases: []string{"cre", "crt", "add"},
1313
}
14-
createCmd.AddCommand(NewUsersCommand())
15-
createCmd.AddCommand(NewPortsCommand())
16-
createCmd.AddCommand(NewPasswordsCommand())
17-
createCmd.AddCommand(NewCachesCommand())
18-
createCmd.AddCommand(NewKeysCommand())
19-
return createCmd
14+
cmd.AddCommand(NewUsersCommand())
15+
cmd.AddCommand(NewPortsCommand())
16+
cmd.AddCommand(NewPasswordsCommand())
17+
cmd.AddCommand(NewCachesCommand())
18+
cmd.AddCommand(NewKeysCommand())
19+
return cmd
2020
}

cmd/create/keys.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ func NewKeysCommand() *cobra.Command {
1010
cmd := &cobra.Command{
1111
Use: "keys <keyFilePath>",
1212
Args: cobra.ExactArgs(1),
13-
Short: "Create a alternate key file path",
14-
Long: "Create a alternate key file path",
13+
Short: "Create an alternative key file path",
14+
Long: "Create an alternative key file path",
1515
Aliases: []string{"key"},
1616
Run: func(cmd *cobra.Command, args []string) {
1717
keyPath := args[0]
1818
configuration := config.LoadConfig()
19-
ctl := control.NewCreateController(control.TypeKeys, keyPath, configuration)
20-
ctl.ExecuteCreate()
19+
controller := control.NewCreateController(control.TypeKeys, keyPath, configuration)
20+
controller.ExecuteCreate()
2121
},
2222
}
2323
return cmd

0 commit comments

Comments
 (0)