feat(bonfire): add FlagBool and read every bare switch with it (IN-04, quick-261028-rqd)
This commit is contained in:
@@ -47,7 +47,7 @@ scripts.`,
|
||||
}
|
||||
infos := r.Routes()
|
||||
if in != nil {
|
||||
if v, _ := in.Flag(jsonFlagName); v == "true" {
|
||||
if bonfire.FlagBool(in, jsonFlagName) {
|
||||
list := make([]routeJSON, 0, len(infos))
|
||||
for _, rt := range infos {
|
||||
mw := rt.Middleware
|
||||
|
||||
@@ -326,7 +326,7 @@ func TestServeGracefulNil(t *testing.T) {
|
||||
func TestRouteListJSON(t *testing.T) {
|
||||
app := backpack.New(writeHTTPConfig(t, "body_limits:\n default_bytes: 1024\n upload_bytes: 1024\n"))
|
||||
cmd := RouteListCommand(app, []party.Plugin{blogPostsPlugin{}})
|
||||
for _, args := range [][]string{{"--json"}, {"--json", "-q"}} {
|
||||
for _, args := range [][]string{{"--json"}, {"--json", "-q"}, {"--json=1"}} {
|
||||
var buf bytes.Buffer
|
||||
if err := bonfire.Call(context.Background(), []bonfire.Command{cmd}, "route:list", args, &buf); err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user