func StatusCommand(getStatus func() (raft.Status, error)) cli.Command {
	statusExecutor := func(strings []string) error {
		status, err := getStatus()
		if err != nil {
			return fmt.Errorf("could not get status, wait for cluster to initialize")
		}
		fmt.Println("Cluster status:")
		fmt.Printf("  - My ID: %v\n", status.ID)
		fmt.Printf("  - Node IDs: %v\n", status.Nodes)
		fmt.Printf("  - Active Nodes (%d): %v\n", len(status.ActiveNodes), status.ActiveNodes)

		return nil
	}

	return cli.CreateCommand("status", "Get the status of the cluster", statusExecutor, nil)
}
// StatusCommand creates the status command which allows the
// user to access information about the status of the cluster.
//
// syntax: status
StatusCommand creates the status command which allows the
user to access information about the status of the cluster.

status
// StatusCommand creates the status command which allows the // user to access information about the status of the cluster . // // syntax : status
func StatusCommand(getStatus func() (raft.Status, error)) cli.Command {
	statusExecutor := func(strings []string) error {
		status, err := getStatus()
		if err != nil {
			return fmt.Errorf("could not get status, wait for cluster to initialize")
		}
		fmt.Println("Cluster status:")
		fmt.Printf("  - My ID: %v\n", status.ID)
		fmt.Printf("  - Node IDs: %v\n", status.Nodes)
		fmt.Printf("  - Active Nodes (%d): %v\n", len(status.ActiveNodes), status.ActiveNodes)
		return nil
	}
	return cli.CreateCommand("status", "Get the status of the cluster", statusExecutor, nil)
}
func StatusCommand ( getStatus func ( ) ( raft . Status , error ) ) cli . Command { statusExecutor := func ( strings [ ] string ) error { status , err := getStatus ( ) if err != nil { return fmt . Errorf ( " " ) } fmt . Println ( " " ) fmt . Printf ( " \n " , status . ID ) fmt . Printf ( " \n " , status . Nodes ) fmt . Printf ( " \n " , len ( status . ActiveNodes ) , status . ActiveNodes ) return nil } return cli . CreateCommand ( " " , " " , statusExecutor , nil ) }
StatusCommand creates the status command which allows the
user to access information about the status of the cluster.
StatusCommand creates the status command which allows the user to access information about the status of the cluster .