@@ -39,7 +39,7 @@ func Entrypoint(serviceName string, makeAdditionalCommands func(string) []*cobra
3939 Use : "start" ,
4040 Short : "Start the service" ,
4141 Args : cobra .NoArgs ,
42- Run : cli .WrapRun (func (ctx context.Context , _ []string ) error {
42+ RunE : cli .WrapRun (func (ctx context.Context , _ []string ) error {
4343 return runSystemctlVerb (ctx , "start" )
4444 }),
4545 })
@@ -48,7 +48,7 @@ func Entrypoint(serviceName string, makeAdditionalCommands func(string) []*cobra
4848 Use : "stop" ,
4949 Short : "Stop the service" ,
5050 Args : cobra .NoArgs ,
51- Run : cli .WrapRun (func (ctx context.Context , _ []string ) error {
51+ RunE : cli .WrapRun (func (ctx context.Context , _ []string ) error {
5252 return runSystemctlVerb (ctx , "stop" )
5353 }),
5454 })
@@ -57,7 +57,7 @@ func Entrypoint(serviceName string, makeAdditionalCommands func(string) []*cobra
5757 Use : "restart" ,
5858 Short : "Restart the service" ,
5959 Args : cobra .NoArgs ,
60- Run : cli .WrapRun (func (ctx context.Context , _ []string ) error {
60+ RunE : cli .WrapRun (func (ctx context.Context , _ []string ) error {
6161 return runSystemctlVerb (ctx , "restart" )
6262 }),
6363 })
@@ -66,7 +66,7 @@ func Entrypoint(serviceName string, makeAdditionalCommands func(string) []*cobra
6666 Use : "status" ,
6767 Short : "Show status of the service" ,
6868 Args : cobra .NoArgs ,
69- Run : cli .WrapRun (func (ctx context.Context , _ []string ) error {
69+ RunE : cli .WrapRun (func (ctx context.Context , _ []string ) error {
7070 translateNonError := func (err error ) error {
7171 if err != nil {
7272 // LSB dictates that successful status show of non-running program must return 3:
@@ -89,7 +89,7 @@ func Entrypoint(serviceName string, makeAdditionalCommands func(string) []*cobra
8989 Use : "logs" ,
9090 Short : "Get logs for the service" ,
9191 Args : cobra .NoArgs ,
92- Run : cli .WrapRun (func (ctx context.Context , _ []string ) error {
92+ RunE : cli .WrapRun (func (ctx context.Context , _ []string ) error {
9393 //nolint:gosec // ok, is expected to not be user input.
9494 logsCmd := exec .CommandContext (ctx , "journalctl" , "--unit=" + serviceName )
9595 logsCmd .Stdout = os .Stdout
@@ -108,7 +108,7 @@ func WithInstallAndUninstallCommands(makeSvc func(string) (*systemdinstaller.Ser
108108 Use : "install" ,
109109 Short : "Installs the background service" ,
110110 Args : cobra .NoArgs ,
111- Run : cli .WrapRun (func (_ context.Context , _ []string ) error {
111+ RunE : cli .WrapRun (func (_ context.Context , _ []string ) error {
112112 svc , err := makeSvc (serviceName )
113113 if err != nil {
114114 return err
0 commit comments