Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings import to command line #10083

Open
wolf99 opened this issue May 12, 2021 · 5 comments
Open

Add settings import to command line #10083

wolf99 opened this issue May 12, 2021 · 5 comments
Labels
Area-Commandline wt.exe's commandline arguments Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements
Milestone

Comments

@wolf99
Copy link
Contributor

wolf99 commented May 12, 2021

Description of the new feature/enhancement

Command line argument allowing the import of new settings files.

This would make scripting of environment setup a bit less fiddly.

Something like

> wt import mySettings.json
Settings imported successfully

Potentially could validate settings during import to prevent overwriting existing settings with invalid ones

> wt import myDodgySettings.json
Settings not valid, import failed.
Ln # 8: "HoopyFrood" is not a valid setting
Ln # 9: "KnowsWhereHisTowelIs" is an unknown value for setting "ArthurDent"
    Acceptable values are "Confused", "Bewildered", or "JustWantsANiceCupOfTea".

If getting really fancy, the command could update valid but older settings to newer schemas

> wt import myValidButOldSettings.json
Whoa, there Magrathean, those settings look a little stale!
Settings updated to new schema
Settings imported successfully
@wolf99 wolf99 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 12, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 12, 2021
@zadjii-msft zadjii-msft added the Area-Commandline wt.exe's commandline arguments label May 13, 2021
@DHowett
Copy link
Member

DHowett commented May 13, 2021

Thanks for the request! We've got a request for supporting import/export for color schemes, and we don't hate the idea . . . but we're wondering what value it adds over "copy the file over the existing settings.json"?

😄

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 13, 2021
@DHowett
Copy link
Member

DHowett commented May 13, 2021

(@miniksa suggests that finding the path to the settings file "sucks")

@DHowett DHowett added this to the Icebox ❄ milestone May 13, 2021
@wolf99
Copy link
Contributor Author

wolf99 commented May 14, 2021

I agree with @miniksa 😊, finding the path is at best non-intuitive.

Additionally the path is fugly, but more importantly it includes your username. For most users this is their actual name. I don't really want that in scripts that are in remote SCM systems or the like.

Further, using an action rather than a path abstracts the path so that WT can change the underlying path used as it may need, e.g. for preview WT vs main WT vs dev WT vs user installation vs system installation, etc.

> wt import --preview --user localTestSettings.json
Settings imported to user installation of terminal preview

I added the extra functionality (validation, etc) in the request just for fun really, but they could be facilitated in such a feature. This would mean that the person doing the configuring (who may not be the same person as the user), can easily know if settings are valid without needing to open the application.

WRT color scheme import, that's a whole other thing IMHO. The imported values would of course end up in the settings.json, and may also need some validation. But I imagine that relates to opening up to the large color profiles community who may not appreciate needing to include the other, non-color related, WT settings in such profiles if these two features were one and the same thing.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 14, 2021
@zadjii-msft zadjii-msft removed Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 14, 2021
@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented May 14, 2021

> wt import mySettings.json
Settings imported successfully

Outputting that to the console of the parent process would have the same difficulties as wt --help in #7258. Just providing an exit code for batch files seems easier, though; even if it ends up requiring something ugly like START /WAIT wt --wait import mySettings.json.

@wolf99
Copy link
Contributor Author

wolf99 commented May 15, 2021

Yeah, exit codes to be preferred.
The sample outputs I've shown here are more to show different functionality for the purposes if this thread only.

I didn't realise there were problems for WT outputting on command line. Even for my sample outputs, I intended that they would be responses in the CLI rather than a modal or the like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Commandline wt.exe's commandline arguments Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements
Projects
None yet
Development

No branches or pull requests

4 participants