@@ -96,17 +96,20 @@ func (m command) build() *cli.Command {
96
96
Name : "config-search-path" ,
97
97
Usage : "Specify the path to search for config files when discovering the entities that should be included in the CDI specification." ,
98
98
Destination : & opts .configSearchPaths ,
99
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CONFIG_SEARCH_PATH" },
99
100
},
100
101
& cli.StringFlag {
101
102
Name : "output" ,
102
103
Usage : "Specify the file to output the generated CDI specification to. If this is '' the specification is output to STDOUT" ,
103
104
Destination : & opts .output ,
105
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_OUTPUT" },
104
106
},
105
107
& cli.StringFlag {
106
108
Name : "format" ,
107
109
Usage : "The output format for the generated spec [json | yaml]. This overrides the format defined by the output file extension (if specified)." ,
108
110
Value : spec .FormatYAML ,
109
111
Destination : & opts .format ,
112
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_FORMAT" },
110
113
},
111
114
& cli.StringFlag {
112
115
Name : "mode" ,
@@ -116,27 +119,32 @@ func (m command) build() *cli.Command {
116
119
"If mode is set to 'auto' the mode will be determined based on the system configuration." ,
117
120
Value : string (nvcdi .ModeAuto ),
118
121
Destination : & opts .mode ,
122
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_MODE" },
119
123
},
120
124
& cli.StringFlag {
121
125
Name : "dev-root" ,
122
126
Usage : "Specify the root where `/dev` is located. If this is not specified, the driver-root is assumed." ,
123
127
Destination : & opts .devRoot ,
128
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_DEV_ROOT" },
124
129
},
125
130
& cli.StringSliceFlag {
126
131
Name : "device-name-strategy" ,
127
132
Usage : "Specify the strategy for generating device names. If this is specified multiple times, the devices will be duplicated for each strategy. One of [index | uuid | type-index]" ,
128
133
Value : cli .NewStringSlice (nvcdi .DeviceNameStrategyIndex , nvcdi .DeviceNameStrategyUUID ),
129
134
Destination : & opts .deviceNameStrategies ,
135
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_DEVICE_NAME_STRATEGY" },
130
136
},
131
137
& cli.StringFlag {
132
138
Name : "driver-root" ,
133
139
Usage : "Specify the NVIDIA GPU driver root to use when discovering the entities that should be included in the CDI specification." ,
134
140
Destination : & opts .driverRoot ,
141
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_DRIVER_ROOT" },
135
142
},
136
143
& cli.StringSliceFlag {
137
144
Name : "library-search-path" ,
138
145
Usage : "Specify the path to search for libraries when discovering the entities that should be included in the CDI specification.\n \t Note: This option only applies to CSV mode." ,
139
146
Destination : & opts .librarySearchPaths ,
147
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_LIBRARY_SEARCH_PATH" },
140
148
},
141
149
& cli.StringFlag {
142
150
Name : "nvidia-cdi-hook-path" ,
@@ -145,36 +153,42 @@ func (m command) build() *cli.Command {
145
153
"If not specified, the PATH will be searched for `nvidia-cdi-hook`. " +
146
154
"NOTE: That if this is specified as `nvidia-ctk`, the PATH will be searched for `nvidia-ctk` instead." ,
147
155
Destination : & opts .nvidiaCDIHookPath ,
156
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_NVIDIA_CDI_HOOK_PATH" },
148
157
},
149
158
& cli.StringFlag {
150
159
Name : "ldconfig-path" ,
151
160
Usage : "Specify the path to use for ldconfig in the generated CDI specification" ,
152
161
Destination : & opts .ldconfigPath ,
162
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_LDCONFIG_PATH" },
153
163
},
154
164
& cli.StringFlag {
155
165
Name : "vendor" ,
156
166
Aliases : []string {"cdi-vendor" },
157
167
Usage : "the vendor string to use for the generated CDI specification." ,
158
168
Value : "nvidia.com" ,
159
169
Destination : & opts .vendor ,
170
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_VENDOR" },
160
171
},
161
172
& cli.StringFlag {
162
173
Name : "class" ,
163
174
Aliases : []string {"cdi-class" },
164
175
Usage : "the class string to use for the generated CDI specification." ,
165
176
Value : "gpu" ,
166
177
Destination : & opts .class ,
178
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CLASS" },
167
179
},
168
180
& cli.StringSliceFlag {
169
181
Name : "csv.file" ,
170
182
Usage : "The path to the list of CSV files to use when generating the CDI specification in CSV mode." ,
171
183
Value : cli .NewStringSlice (csv .DefaultFileList ()... ),
172
184
Destination : & opts .csv .files ,
185
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CSV_FILE" },
173
186
},
174
187
& cli.StringSliceFlag {
175
188
Name : "csv.ignore-pattern" ,
176
189
Usage : "Specify a pattern the CSV mount specifications." ,
177
190
Destination : & opts .csv .ignorePatterns ,
191
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CSV_IGNORE_PATTERN" },
178
192
},
179
193
}
180
194
0 commit comments