From c5ced36a48da73fb573de8d4d53167cb892c1348 Mon Sep 17 00:00:00 2001 From: Binaek Sarkar Date: Fri, 6 May 2022 18:11:19 +0530 Subject: [PATCH] Hides the '--schema-comments' flag in the root 'steampipe' command. Closes #2010 --- cmd/root.go | 8 ++++++++ .../test_data/templates/expected_plugin_help_output.txt | 1 - .../test_data/templates/expected_service_help_output.txt | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 55764e890..fbac2081c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -101,6 +101,14 @@ func InitCmd() { rootCmd.CompletionOptions.DisableDefaultCmd = true rootCmd.Flags().BoolP(constants.ArgHelp, "h", false, "Help for steampipe") rootCmd.Flags().BoolP(constants.ArgVersion, "v", false, "Version for steampipe") + + hideRootFlags(constants.ArgSchemaComments) +} + +func hideRootFlags(flags ...string) { + for _, flag := range flags { + rootCmd.Flag(flag).Hidden = true + } } // initConfig reads in config file and ENV variables if set. diff --git a/tests/acceptance/test_data/templates/expected_plugin_help_output.txt b/tests/acceptance/test_data/templates/expected_plugin_help_output.txt index f4931bdbc..3b3d852e9 100644 --- a/tests/acceptance/test_data/templates/expected_plugin_help_output.txt +++ b/tests/acceptance/test_data/templates/expected_plugin_help_output.txt @@ -33,7 +33,6 @@ Global Flags: --cloud-host string Steampipe Cloud host (default "cloud.steampipe.io") --cloud-token string Steampipe Cloud authentication token --install-dir string Path to the Config Directory (defaults to ~/.steampipe) (default "~/.steampipe") - --schema-comments Include schema comments when importing connection schemas (default true) --workspace string Path to the workspace working directory (DEPRECATED: please use workspace-chdir) --workspace-chdir string Path to the workspace working directory --workspace-database string Steampipe Cloud workspace database (default "local") diff --git a/tests/acceptance/test_data/templates/expected_service_help_output.txt b/tests/acceptance/test_data/templates/expected_service_help_output.txt index 513b46e40..197258fba 100644 --- a/tests/acceptance/test_data/templates/expected_service_help_output.txt +++ b/tests/acceptance/test_data/templates/expected_service_help_output.txt @@ -19,7 +19,6 @@ Global Flags: --cloud-host string Steampipe Cloud host (default "cloud.steampipe.io") --cloud-token string Steampipe Cloud authentication token --install-dir string Path to the Config Directory (defaults to ~/.steampipe) (default "~/.steampipe") - --schema-comments Include schema comments when importing connection schemas (default true) --workspace string Path to the workspace working directory (DEPRECATED: please use workspace-chdir) --workspace-chdir string Path to the workspace working directory --workspace-database string Steampipe Cloud workspace database (default "local")