Allow running native hosts messaging as default if binary endswith native_host
@@ -3,6 +3,7 @@ package main
import (
"context"
"os"
+ "strings"
"github.com/blang/semver"
ap "github.com/justwatchcom/gopass/pkg/action"
@@ -57,6 +58,10 @@ func setupApp(ctx context.Context, sv semver.Version) *cli.App {
}
app.Action = func(c *cli.Context) error {
+ if strings.HasSuffix(os.Args[0], "native_host") || strings.HasSuffix(os.Args[0], "native_host.exe") {
+ return action.JSONAPI(withGlobalFlags(ctx, c), c)
+ }
+
if err := action.Initialized(withGlobalFlags(ctx, c), c); err != nil {
return err
}
