Skip to content

Make command-line arguments -i "" launch the portable instance#2341

Open
JonathanFeenstra wants to merge 2 commits intoModOrganizer2:masterfrom
JonathanFeenstra:cmd-portable
Open

Make command-line arguments -i "" launch the portable instance#2341
JonathanFeenstra wants to merge 2 commits intoModOrganizer2:masterfrom
JonathanFeenstra:cmd-portable

Conversation

@JonathanFeenstra
Copy link
Copy Markdown
Member

@JonathanFeenstra JonathanFeenstra commented Feb 21, 2026

Closes #1633

The check for -i with no arguments doesn't distinguish between -i "" or just -i:

// handle -i with no arguments
if (m_vm.count("instance") && m_vm["instance"].as<std::string>() == "") {

So if we want -i "" to also launch the portable instance, we need to find another way to distinguish between those cases. I don't think we really need that though.

I changed it to use boost::optional so we can distinguish between those cases now. @Al12rs didn't like using -i "Portable", since there could be a global instance named "Portable".

@Silarn Silarn closed this Apr 15, 2026
@Silarn Silarn reopened this Apr 15, 2026
@JonathanFeenstra JonathanFeenstra marked this pull request as draft April 15, 2026 20:46
@JonathanFeenstra JonathanFeenstra changed the title Make command-line arguments -i "Portable" launch the portable instance Make command-line arguments -i "" launch the portable instance Apr 15, 2026
@JonathanFeenstra JonathanFeenstra marked this pull request as ready for review April 15, 2026 21:27
@Al12rs
Copy link
Copy Markdown
Member

Al12rs commented Apr 16, 2026

Were you able to test if this distinguishes between no param and empty string?

Could we use std::optional rather than the boost version or was there a reason to use boost?

@JonathanFeenstra
Copy link
Copy Markdown
Member Author

Were you able to test if this distinguishes between no param and empty string?

Yes, I confirmed it's working correctly for both -i and -i "" as command-line arguments.

Could we use std::optional rather than the boost version or was there a reason to use boost?

I tried std::optional first, but unfortunately that isn't supported by boost::program_options::variables_map because it's not a streamable type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open portable instance from command line

3 participants