@@ -107,8 +107,16 @@ namespace AppInstaller::CLI::Workflow
107
107
std::string_view name = context.Args .GetArg (Args::Type::SourceName);
108
108
std::string_view arg = context.Args .GetArg (Args::Type::SourceArg);
109
109
std::string_view type = context.Args .GetArg (Args::Type::SourceType);
110
+ bool isExplicit = context.Args .Contains (Args::Type::SourceExplicit);
110
111
111
- Repository::Source sourceToAdd{ name, arg, type };
112
+ Repository::SourceTrustLevel trustLevel = Repository::SourceTrustLevel::None;
113
+ if (context.Args .Contains (Execution::Args::Type::SourceTrustLevel))
114
+ {
115
+ std::vector<std::string> trustLevelArgs = Utility::Split (std::string{ context.Args .GetArg (Execution::Args::Type::SourceTrustLevel) }, ' |' , true );
116
+ trustLevel = Repository::ConvertToSourceTrustLevelFlag (trustLevelArgs);
117
+ }
118
+
119
+ Repository::Source sourceToAdd{ name, arg, type, trustLevel, isExplicit};
112
120
113
121
if (context.Args .Contains (Execution::Args::Type::CustomHeader))
114
122
{
@@ -156,6 +164,8 @@ namespace AppInstaller::CLI::Workflow
156
164
table.OutputLine ({ Resource::LocString (Resource::String::SourceListArg), source.Arg });
157
165
table.OutputLine ({ Resource::LocString (Resource::String::SourceListData), source.Data });
158
166
table.OutputLine ({ Resource::LocString (Resource::String::SourceListIdentifier), source.Identifier });
167
+ table.OutputLine ({ Resource::LocString (Resource::String::SourceListTrustLevel), Repository::GetSourceTrustLevelForDisplay (source.TrustLevel )});
168
+ table.OutputLine ({ Resource::LocString (Resource::String::SourceListExplicit), std::string{ Utility::ConvertBoolToString (source.Explicit ) }});
159
169
160
170
if (source.LastUpdateTime == Utility::ConvertUnixEpochToSystemClock (0 ))
161
171
{
@@ -181,10 +191,10 @@ namespace AppInstaller::CLI::Workflow
181
191
}
182
192
else
183
193
{
184
- Execution::TableOutput<2 > table (context.Reporter , { Resource::String::SourceListName, Resource::String::SourceListArg });
194
+ Execution::TableOutput<3 > table (context.Reporter , { Resource::String::SourceListName, Resource::String::SourceListArg, Resource::String::SourceListExplicit });
185
195
for (const auto & source : sources)
186
196
{
187
- table.OutputLine ({ source.Name , source.Arg });
197
+ table.OutputLine ({ source.Name , source.Arg , std::string{ Utility::ConvertBoolToString (source. Explicit ) } });
188
198
}
189
199
table.Complete ();
190
200
}
@@ -199,6 +209,7 @@ namespace AppInstaller::CLI::Workflow
199
209
}
200
210
201
211
const std::vector<Repository::SourceDetails>& sources = context.Get <Data::SourceList>();
212
+
202
213
for (const auto & sd : sources)
203
214
{
204
215
Repository::Source source{ sd.Name };
@@ -303,6 +314,10 @@ namespace AppInstaller::CLI::Workflow
303
314
s.Arg = source.Arg ;
304
315
s.Data = source.Data ;
305
316
s.Identifier = source.Identifier ;
317
+
318
+ std::vector<std::string_view> sourceTrustLevels = Repository::SourceTrustLevelFlagToList (source.TrustLevel );
319
+ s.TrustLevel = std::vector<std::string>(sourceTrustLevels.begin (), sourceTrustLevels.end ());
320
+ s.Explicit = source.Explicit ;
306
321
context.Reporter .Info () << s.ToJsonString () << std::endl;
307
322
}
308
323
}
0 commit comments