mirror of
https://github.com/Adembc/lazyssh.git
synced 2026-07-14 12:13:34 +02:00
draft ui
This commit is contained in:
+9
-1
@@ -552,7 +552,10 @@ func printServers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var versionFlag bool
|
var (
|
||||||
|
versionFlag bool
|
||||||
|
listFlag bool
|
||||||
|
)
|
||||||
|
|
||||||
rootCmd := &cobra.Command{
|
rootCmd := &cobra.Command{
|
||||||
Use: AppName,
|
Use: AppName,
|
||||||
@@ -562,11 +565,16 @@ func main() {
|
|||||||
fmt.Println(AppVersion)
|
fmt.Println(AppVersion)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if listFlag {
|
||||||
|
printServers()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return runTUI()
|
return runTUI()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
rootCmd.SilenceUsage = true
|
rootCmd.SilenceUsage = true
|
||||||
rootCmd.PersistentFlags().BoolVarP(&versionFlag, "version", "v", false, "Print version and exit")
|
rootCmd.PersistentFlags().BoolVarP(&versionFlag, "version", "v", false, "Print version and exit")
|
||||||
|
rootCmd.PersistentFlags().BoolVarP(&listFlag, "list", "l", false, "Print list of servers and exit")
|
||||||
|
|
||||||
versionCmd := &cobra.Command{
|
versionCmd := &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
|
|||||||
Reference in New Issue
Block a user