Exemplo n.º 1
0
// RegisterAll registers all romulus commands with the
// provided command registry.
func RegisterAll(r commandRegister) {
	r.Register(agree.NewAgreeCommand())
	r.Register(allocate.NewAllocateCommand())
	r.Register(createbudget.NewCreateBudgetCommand())
	r.Register(listbudgets.NewListBudgetsCommand())
	r.Register(listplans.NewListPlansCommand())
	r.Register(setbudget.NewSetBudgetCommand())
	r.Register(setplan.NewSetPlanCommand())
	r.Register(showbudget.NewShowBudgetCommand())
	r.Register(updateallocation.NewUpdateAllocationCommand())
}
Exemplo n.º 2
0
// RegisterAll registers all romulus commands with the
// provided command registry.
func RegisterAll(r commandRegister) {
	register := func(c cmd.Command) {
		switch c := c.(type) {
		case modelcmd.ModelCommand:
			r.Register(modelcmd.Wrap(c))
		case modelcmd.CommandBase:
			r.Register(modelcmd.WrapBase(c))
		default:
			r.Register(c)
		}

	}
	register(agree.NewAgreeCommand())
	register(listagreements.NewListAgreementsCommand())
	register(allocate.NewAllocateCommand())
	register(listbudgets.NewListBudgetsCommand())
	register(createbudget.NewCreateBudgetCommand())
	register(listplans.NewListPlansCommand())
	register(setbudget.NewSetBudgetCommand())
	register(setplan.NewSetPlanCommand())
	register(showbudget.NewShowBudgetCommand())
	register(updateallocation.NewUpdateAllocationCommand())
}