From 03b0c508d8bec7166b10eea787bb57ca061634ad Mon Sep 17 00:00:00 2001 From: tiglog Date: Sun, 15 Oct 2023 00:33:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=20cli=5Fcontract?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=EF=BC=8C=E5=90=88=E5=B9=B6=E5=88=B0=20con?= =?UTF-8?q?sole.go=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- console/cli_contract.go | 25 ------------------------- console/console.go | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 console/cli_contract.go diff --git a/console/cli_contract.go b/console/cli_contract.go deleted file mode 100644 index 07255cb..0000000 --- a/console/cli_contract.go +++ /dev/null @@ -1,25 +0,0 @@ -// -// cli_contact.go -// Copyright (C) 2022 tiglog -// -// 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 diff --git a/console/console.go b/console/console.go index edaee70..291dcae 100644 --- a/console/console.go +++ b/console/console.go @@ -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