Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ While work is in progress on uninstall, the command is hidden behind a feature t
},
```

### importExport
### import

While work is in progress for import and export, the command is hidden behind a feature toggle. One can enable it as below:
While work is in progress for import, the command is hidden behind a feature toggle. One can enable it as below:

```
"experimentalFeatures": {
"importExport": true
"import": true
},
```
6 changes: 3 additions & 3 deletions schemas/JSON/settings/settings.schema.0.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
"type": "boolean",
"default": false
},
"importExport": {
"description": "Enable the import and export commands",
"import": {
"description": "Enable the import command while it is in development",
"type": "boolean",
"default": false
}
}
}
},
"allOf": [
"allOf": [
{
"properties": {
"visual": { "$ref": "#/definitions/Visual" }
Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCLICore/Commands/ExportCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AppInstaller::CLI
// Command to get the set of installed packages on the system.
struct ExportCommand final : public Command
{
ExportCommand(std::string_view parent) : Command("export", parent, Settings::ExperimentalFeature::Feature::ExperimentalImportExport) {}
ExportCommand(std::string_view parent) : Command("export", parent, Settings::ExperimentalFeature::Feature::ExperimentalExport) {}

std::vector<Argument> GetArguments() const override;

Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCLICore/Commands/ImportCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AppInstaller::CLI
// Command to install a set of packages from a list.
struct ImportCommand final : public Command
{
ImportCommand(std::string_view parent) : Command("import", parent, Settings::ExperimentalFeature::Feature::ExperimentalImportExport) {}
ImportCommand(std::string_view parent) : Command("import", parent, Settings::ExperimentalFeature::Feature::ExperimentalImport) {}

std::vector<Argument> GetArguments() const override;

Expand Down
3 changes: 2 additions & 1 deletion src/AppInstallerCLIE2ETests/ImportCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public class ImportCommand : BaseCommand
public void Setup()
{
InitializeAllFeatures(false);
ConfigureFeature("importExport", true);
ConfigureFeature("import", true);
ConfigureFeature("export", true);
CleanupTestExe();
}

Expand Down
12 changes: 8 additions & 4 deletions src/AppInstallerCommonCore/ExperimentalFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ namespace AppInstaller::Settings
return User().Get<Setting::EFExperimentalUpgrade>();
case Feature::ExperimentalUninstall:
return User().Get<Setting::EFUninstall>();
case Feature::ExperimentalImportExport:
return User().Get<Setting::EFImportExport>();
case Feature::ExperimentalImport:
return User().Get<Setting::EFImport>();
case Feature::ExperimentalExport:
return User().Get<Setting::EFExport>();
default:
THROW_HR(E_UNEXPECTED);
}
Expand All @@ -50,8 +52,10 @@ namespace AppInstaller::Settings
return ExperimentalFeature{ "Upgrade Command", "upgrade", "https://aka.ms/winget-settings", Feature::ExperimentalUpgrade };
case Feature::ExperimentalUninstall:
return ExperimentalFeature{ "Uninstall Command", "uninstall", "https://aka.ms/winget-settings", Feature::ExperimentalUninstall };
case Feature::ExperimentalImportExport:
return ExperimentalFeature{ "Import & Export Commands", "importExport", "https://aka.ms/winget-settings", Feature::ExperimentalImportExport };
case Feature::ExperimentalImport:
return ExperimentalFeature{ "Import Command", "import", "https://aka.ms/winget-settings", Feature::ExperimentalImport };
case Feature::ExperimentalExport:
return ExperimentalFeature{ "Export Command", "export", "https://aka.ms/winget-settings", Feature::ExperimentalExport };
default:
THROW_HR(E_UNEXPECTED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ namespace AppInstaller::Settings
ExperimentalList = 0x8,
ExperimentalUpgrade = 0x10,
ExperimentalUninstall = 0x20,
ExperimentalImportExport = 0x40,
Max, // This MUST always be last
ExperimentalImport = 0x40,
Max, // This MUST always be after all experimental features

// Features listed after Max will not be shown with the features command
// This can be used to hide highly experimental features
ExperimentalExport = 0x80
};

using Feature_t = std::underlying_type_t<ExperimentalFeature::Feature>;
Expand Down
6 changes: 4 additions & 2 deletions src/AppInstallerCommonCore/Public/winget/UserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ namespace AppInstaller::Settings
EFList,
EFExperimentalUpgrade,
EFUninstall,
EFImportExport,
EFImport,
EFExport,
Max
};

Expand Down Expand Up @@ -88,7 +89,8 @@ namespace AppInstaller::Settings
SETTINGMAPPING_SPECIALIZATION(Setting::EFList, bool, bool, false, ".experimentalFeatures.list"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFExperimentalUpgrade, bool, bool, false, ".experimentalFeatures.upgrade"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFUninstall, bool, bool, false, ".experimentalFeatures.uninstall"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFImportExport, bool, bool, false, ".experimentalFeatures.importExport"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFImport, bool, bool, false, ".experimentalFeatures.import"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFExport, bool, bool, false, ".experimentalFeatures.export"sv);

// Used to deduce the SettingVariant type; making a variant that includes std::monostate and all SettingMapping types.
template <size_t... I>
Expand Down
10 changes: 8 additions & 2 deletions src/AppInstallerCommonCore/UserSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,14 @@ namespace AppInstaller::Settings
return value;
}

std::optional<SettingMapping<Setting::EFImportExport>::value_t>
SettingMapping<Setting::EFImportExport>::Validate(const SettingMapping<Setting::EFImportExport>::json_t& value)
std::optional<SettingMapping<Setting::EFImport>::value_t>
SettingMapping<Setting::EFImport>::Validate(const SettingMapping<Setting::EFImport>::json_t& value)
{
return value;
}

std::optional<SettingMapping<Setting::EFExport>::value_t>
SettingMapping<Setting::EFExport>::Validate(const SettingMapping<Setting::EFExport>::json_t& value)
{
return value;
}
Expand Down