Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JKme authored and JKme committed Jun 27, 2021
1 parent 59b992a commit 23b8cf3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
27 changes: 1 addition & 26 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,13 @@ var rootCmd = &cobra.Command{
// Execute is the main cobra method

func Execute() {
//signalChan := make(chan os.Signal, 1)
//signal.Notify(signalChan, os.Interrupt)
//defer func() {
// signal.Stop(signalChan)
// cancel()
//}()
//go func() {
// select {
// case <-signalChan:
// // caught CTRL+C
// fmt.Println("\n[!] Keyboard interrupt detected, terminating.")
// cancel()
// case <-mainContext.Done():
// }
//}()

if err := rootCmd.Execute(); err != nil {
// Leaving this in results in the same error appearing twice
// Once before and once after the help output. Not sure if
// this is going to be needed to output other errors that
// aren't automatically outputted.
// fmt.Println(err)

os.Exit(1)
}
}

//func configureGlobalOptions() {
// if err := rootCmd.MarkPersistentFlagRequired("plugin"); err != nil {
// log.Fatalf("error on marking flag as required: %v", err)
// }
//}

func parseGlobalOptions() (*model.GlobalOptions, error) {
globalopts := model.NewGlobalOptions()
threads, _ := rootCmd.Flags().GetInt("threads")
Expand Down
8 changes: 0 additions & 8 deletions cli/cmd/sqlcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,5 @@ func init() {
sqlCli.Flags().StringP("password", "p", "", "login password")
sqlCli.Flags().StringP("query", "e", "", "string to query or exec")

//if err := probeCmd.MarkPersistentFlagRequired("plugin"); err != nil {
// log.Fatalf("on marking flag as required: %v", err)
// //log.Fatalf("error on marking flag as required: %v", err)
//}

//probeCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
//
//}
rootCmd.AddCommand(sqlCli)
}
2 changes: 1 addition & 1 deletion cubelib/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func SameStringSlice(x, y []string) bool {
}

func RemoveRepByMap(slc []string) []string {
result := []string{}
var result []string
tempMap := map[string]byte{} // 存放不重复主键
for _, e := range slc {
l := len(tempMap)
Expand Down

0 comments on commit 23b8cf3

Please sign in to comment.