From 34f123c23a00949a0602b6778500e462da3940c9 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Fri, 26 Jul 2019 17:15:51 -0700 Subject: [PATCH] Boolean flags by presence (#283) --- conventions/cli.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conventions/cli.md b/conventions/cli.md index db68aa703..c7f5fa27b 100644 --- a/conventions/cli.md +++ b/conventions/cli.md @@ -64,6 +64,13 @@ In this case `foo` is positional, and refers to the service to create. example, `--image=img.repo/asdf` in Knative Serving sets `spec.template.containers[0].image` +* Flags that control a boolean behavior (eg. generate a name or not) are + specified by their presence. The default happens when the flag is not present, + and adding the flag marks the user's desire for the non-default thing. When + the flag *disables* a default behavior which is to do something, it should + start with `no` (eg. `--no-generate-name` when the default is to generate a + name). + #### Output Commands that output information should support `--output` with a shorthand of