The hint is a comment in the output people feed to eval, so a line break in a selector value ended the comment and ran the rest. Such a value now prints as a placeholder. Fish and PowerShell always get quotes, because the plain-word rule is POSIX and @team is a splat in PowerShell. Addresses the review of #74.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
A profile can set output: json, so the hint now adds -o text after --profile; pasted without it, the shell received JSON. Selector values are quoted for the shell the hint is for, since PowerShell and fish do not read the POSIX form. Addresses the review of #74.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): add --json, --no-emoji, config profile edit and a warning for servers too old for the CLI
--json is shorthand for --output json. Marks are plain ASCII with --no-emoji, when output is piped and under NO_COLOR. config profile edit opens a profile in VISUAL or EDITOR and checks it still reads. status and version warn on stderr when the AWS server is older than the minimum the CLI supports.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): keep the upgrade hint on the selected instance and read quoted editor commands
The old-server hint names the instance it is about and suggests a restart, which keeps that instance's settings. The update notice follows --no-emoji and NO_COLOR. VISUAL and EDITOR are split like a shell would, so a quoted path with spaces works.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): keep Windows paths in editor values and say what to do for a pinned image
A backslash in VISUAL or EDITOR is an escape only before a space or a quote, so Windows paths come through intact. The old-server hint explains that restart keeps a pinned tag and how to change it.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(config): let profile edit open a profile that no longer parses
edit asked the store to parse the profile before opening it, so the one profile that needed repairing could not be opened. A file holding YAML's null is now reported as a profile without settings instead of failing with an exception.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(cli): end every error message with what to do next
Docker, snapshot, update and config profile errors now say how to recover (check Docker, run doctor or status, fix or delete the profile file, pass the missing profile name) instead of stopping at the failure. A test keeps new error messages to the convention.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(cli): keep the next step after docker's own output and name the instance in snapshot hints
Docker's error output ends in a newline and can span lines, which read as 'already has a next step' and hid the hint. The exception now knows whether its text is docker's output or the CLI's own advice. Snapshot hints select the same instance again.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
The closing hint of floci env (all four products) now uses source for fish and Invoke-Expression for PowerShell instead of always suggesting eval, and an unknown --shell exits 2 with the accepted values instead of silently printing bash syntax. zsh, sh and pwsh are accepted by name.
`floci az env` printed the semicolon-separated Azure connection string
unquoted, so `eval $(floci az env)` set only
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=http and ran the
remaining segments as commands — `az` then reported "Invalid connection
string".
`floci env` and `floci gcp env` carried a byte-identical copy of the same
unquoted emitter (their values are `;`-free URLs today, so nobody hit it),
and the aws.cli.endpoint / az.cli.connection-string doctor checks suggested
export lines with the same flaw.
Extract the correct emitter that `floci oci env` already had into
io.floci.cli.output.ShellExport and use it everywhere: values are single
quoted with per-shell escaping for bash, fish, and PowerShell, so `;`, `$`,
backticks, and quotes can neither break nor inject through `eval`.
OciEnvFormatTest becomes ShellExportTest, keeping its four assertions and
adding the connection-string regression from the issue.
Closes#18