From 1fa652b993e62bb231668f0fb696f83cc13fe82e Mon Sep 17 00:00:00 2001 From: Kristoffer Ahl Date: Thu, 15 Oct 2020 09:33:13 +0200 Subject: [PATCH] - Made serve a subcommand of internal. --- cmd/centry/commands.go | 12 ++++++++++-- cmd/centry/runtime.go | 4 ++-- cmd/centry/runtime_test.go | 1 + internal/pkg/config/schema.go | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cmd/centry/commands.go b/cmd/centry/commands.go index 9b215f9..896b976 100644 --- a/cmd/centry/commands.go +++ b/cmd/centry/commands.go @@ -12,7 +12,7 @@ import ( "github.com/urfave/cli/v2" ) -func registerBuiltinCommands(runtime *Runtime) { +func registerInternalCommands(runtime *Runtime) { context := runtime.context if context.executor == CLI { @@ -22,7 +22,15 @@ func registerBuiltinCommands(runtime *Runtime) { "command": "serve", }), } - runtime.cli.Commands = append(runtime.cli.Commands, serveCmd.ToCLICommand()) + internalCmd := &cli.Command{ + Name: "internal", + Usage: "Internal centry commands", + UsageText: "", + Subcommands: []*cli.Command{ + serveCmd.ToCLICommand(), + }, + } + runtime.cli.Commands = append(runtime.cli.Commands, internalCmd) } } diff --git a/cmd/centry/runtime.go b/cmd/centry/runtime.go index 4903acb..774640f 100644 --- a/cmd/centry/runtime.go +++ b/cmd/centry/runtime.go @@ -79,8 +79,8 @@ func NewRuntime(inputArgs []string, context *Context) (*Runtime, error) { }, } - // Register builtin commands - registerBuiltinCommands(runtime) + // Register internal commands + registerInternalCommands(runtime) // Register manifest commands registerManifestCommands(runtime, options) diff --git a/cmd/centry/runtime_test.go b/cmd/centry/runtime_test.go index 82b5ab7..add0df9 100644 --- a/cmd/centry/runtime_test.go +++ b/cmd/centry/runtime_test.go @@ -268,6 +268,7 @@ func TestMain(t *testing.T) { expected := `COMMANDS: commandtest Command tests helptest Help tests + internal Internal centry commands optiontest Option tests scripttest Script tests` diff --git a/internal/pkg/config/schema.go b/internal/pkg/config/schema.go index 2853311..e0d164d 100644 --- a/internal/pkg/config/schema.go +++ b/internal/pkg/config/schema.go @@ -84,7 +84,7 @@ func schemasManifestJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "schemas/manifest.json", size: 1902, mode: os.FileMode(0644), modTime: time.Unix(1586454269, 0)} + info := bindataFileInfo{name: "schemas/manifest.json", size: 1902, mode: os.FileMode(0644), modTime: time.Unix(1602746969, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x80, 0x91, 0x57, 0x15, 0x23, 0x1b, 0x55, 0x70, 0x27, 0x3, 0xfc, 0xf7, 0xa2, 0xc4, 0x2d, 0x9, 0x58, 0x71, 0xea, 0x44, 0x6b, 0xef, 0x15, 0xa, 0xf3, 0x2b, 0x9e, 0x5c, 0x2d, 0x9e, 0x51, 0x6c}} return a, nil }