Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make blobberID field mandatory for sp-info command #307

Merged
merged 4 commits into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions cmd/stakepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ var spInfo = &cobra.Command{

doJSON, _ := cmd.Flags().GetBool("json")

if flags.Changed("blobber_id") {
if blobberID, err = flags.GetString("blobber_id"); err != nil {
log.Fatalf("can't get 'blobber_id' flag: %v", err)
}
if !flags.Changed("blobber_id") {
log.Fatalf("Error: blobber_id flag is missing")
}

blobberID, err = flags.GetString("blobber_id")
if err != nil {
log.Fatalf("Error: cannot get the value of blobber_id")
}

var info *sdk.StakePoolInfo
Expand Down Expand Up @@ -267,7 +270,7 @@ func init() {
rootCmd.AddCommand(spUnlock)

spInfo.PersistentFlags().String("blobber_id", "",
"for given blobber, default is current client")
"for given blobber")
spInfo.PersistentFlags().Bool("json", false, "pass this option to print response as json data")

spUserInfo.PersistentFlags().Bool("json", false, "pass this option to print response as json data")
Expand Down