From af633e81f3d4b1087d743752fd83d298379b5f32 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Tue, 4 Jun 2019 07:25:49 -0700 Subject: [PATCH] Presentation tweak --- .../command-line-subcommands/command-line-subcommands.go | 6 +++--- .../command-line-subcommands.hash | 4 ++-- public/command-line-subcommands | 8 ++++---- public/variables | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/command-line-subcommands/command-line-subcommands.go b/examples/command-line-subcommands/command-line-subcommands.go index 132c9ec..af57b21 100644 --- a/examples/command-line-subcommands/command-line-subcommands.go +++ b/examples/command-line-subcommands/command-line-subcommands.go @@ -36,10 +36,10 @@ func main() { // Check which subcommand is invoked. switch os.Args[1] { - case "foo": - // For every subcommand, we parse its own flags and - // have access to trailing positional arguments. + // For every subcommand, we parse its own flags and + // have access to trailing positional arguments. + case "foo": fooCmd.Parse(os.Args[2:]) fmt.Println("subcommand 'foo'") fmt.Println(" enable:", *fooEnable) diff --git a/examples/command-line-subcommands/command-line-subcommands.hash b/examples/command-line-subcommands/command-line-subcommands.hash index b26ba5f..f22bcc8 100644 --- a/examples/command-line-subcommands/command-line-subcommands.hash +++ b/examples/command-line-subcommands/command-line-subcommands.hash @@ -1,2 +1,2 @@ -673d7811734cfd8f8f5bcb411e12def1e158cf0b -V7xR3wMkquz +5a0ec258e4992e9b93b11d48f2f249092ff3db66 +gtgSAg76N4I diff --git a/public/command-line-subcommands b/public/command-line-subcommands index 190970c..f53c19f 100644 --- a/public/command-line-subcommands +++ b/public/command-line-subcommands @@ -32,7 +32,7 @@ subcommands that have their own flags.

- +
package main
 
@@ -124,7 +124,6 @@ to the program.

    switch os.Args[1] {
-    case "foo":
 
@@ -138,7 +137,8 @@ have access to trailing positional arguments.

-
        fooCmd.Parse(os.Args[2:])
+            
    case "foo":
+        fooCmd.Parse(os.Args[2:])
         fmt.Println("subcommand 'foo'")
         fmt.Println("  enable:", *fooEnable)
         fmt.Println("  name:", *fooName)
@@ -218,7 +218,7 @@ have access to trailing positional arguments.

flag provided but not defined: -enable Usage of bar: -level int - bar level + level
diff --git a/public/variables b/public/variables index a02f89a..a10e9c0 100644 --- a/public/variables +++ b/public/variables @@ -150,7 +150,7 @@ initializing a variable, e.g. for 1 2 true 0 -short +apple