-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds 'unsafe' command to provide support for testing features from the CLI. - The 'unsafe' command introduces additional flags in its subcommands, specifically designed for testing purposes. - The 'charon unsafe' command is hidden from the 'charon --help' output. - Regular usage of commands will not include any test-only flags, whereas these flags will be available in the 'unsafe' command for testing purposes. category: feature ticket: none
- Loading branch information
Showing
7 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright © 2022-2023 Obol Labs Inc. Licensed under the terms of a Business Source License 1.1 | ||
|
||
package cmd | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
func newUnsafeCmd(cmds ...*cobra.Command) *cobra.Command { | ||
unsafe := &cobra.Command{ | ||
Use: "unsafe", | ||
Short: "Unsafe subcommands provides regular charon commands for testing purposes", | ||
Long: "Unsafe subcommands is a group of subcommands that includes both normal and test flags. " + | ||
"It is intended for internal testing of the Charon client and should be used with caution.", | ||
} | ||
|
||
// Mark unsafe command as hidden for internal testing purposes. | ||
unsafe.Hidden = true | ||
unsafe.AddCommand(cmds...) | ||
|
||
return unsafe | ||
} |