refactor: 删除 cli_contract 文件,合并到 console.go 文件

This commit is contained in:
tiglog 2023-10-15 00:33:36 +08:00
parent 663d103dc9
commit 03b0c508d8
2 changed files with 17 additions and 25 deletions

View File

@ -1,25 +0,0 @@
//
// cli_contact.go
// Copyright (C) 2022 tiglog <me@tiglog.com>
//
// Distributed under terms of the MIT license.
//
package console
type ICommand interface {
Init(args []string)
GetName() string
GetDesc() string
GetAction() ActionHandler
GetHelp() string
}
type IConsole interface {
GetCmds() map[string]ICommand
GetName() string
GetDesc() string
GetVersion() string
GetExtraAbout() ActionHandler
}
type ActionHandler func() error

View File

@ -94,3 +94,20 @@ func (s *sApp) Run(args []string) {
os.Exit(1)
}
}
type ICommand interface {
Init(args []string)
GetName() string
GetDesc() string
GetAction() ActionHandler
GetHelp() string
}
type IConsole interface {
GetCmds() map[string]ICommand
GetName() string
GetDesc() string
GetVersion() string
GetExtraAbout() ActionHandler
}
type ActionHandler func() error