We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cad8d8e commit 4d13e03Copy full SHA for 4d13e03
terraformedinventory.go
@@ -29,14 +29,16 @@ func main() {
29
flag.Parse()
30
file := flag.Arg(0)
31
32
- if !*list && *host == "" {
33
- }
34
-
35
if file == "" {
36
fmt.Printf("Usage: %s [options] path\n", os.Args[0])
37
os.Exit(1)
38
}
39
+ if !*list && *host == "" {
+ fmt.Println("Either --host or --list must be specified")
+ os.Exit(1)
40
+ }
41
+
42
path, err := filepath.Abs(file)
43
if err != nil {
44
fmt.Printf("Invalid file: %s\n", err)
@@ -62,10 +64,6 @@ func main() {
62
64
} else if *host != "" {
63
65
host := mustGetHost(state, *host)
66
os.Stdout.Write(mustMarshal(host.vars))
- } else {
67
- fmt.Println("Either --host or --list must be specified")
68
- os.Exit(1)
69
70
71
0 commit comments