Repository navigation
Add nbox profile remove; fix the profile-add setup hint - #66
Merged
Merged
Conversation
Add `nbox profile remove <name>`, which deletes a profile from the config (format-preserving). It refuses to remove the active profile (switch with `nbox profile use <other>` first) or the only profile, mirroring the TUI's delete guards — so a stray profile (e.g. one left by the first-run onboarding wizard) can be dropped without hand-editing the file. Also fix the `--no-tui` first-run setup hint, which printed the wrong `profile add` syntax (`--url <url>`); the URL is a positional argument. The hint now matches the CLI and every user-facing doc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two small CLI fixes that came out of a first-run report (a stray duplicate profile + a bad setup hint).
nbox profile remove <name>(new)Deletes a profile from the config, format-preserving (reuses the existing
config::remove_profiletoml_edit helper that the TUI already uses). Guards mirror the TUI's delete behavior:switch with \nbox profile use ` first`)no profile named '<name>'This gives a shell one-liner to drop a profile the first-run onboarding wizard leaves behind. The wizard always names its profile
default(onboarding.rs), so a user who onboards in the TUI and thenprofile adds a real profile ends up with a duplicatedefaultthey previously had to hand-edit out.Fix the
--no-tuisetup hintno_tui_onboarding_refusal()printed:--urldoesn't exist — the URL is a positional argument (cli.rs), so copy-pasting the hint errored withunexpected argument '--url'. Every user-facing doc (README, CONFIG, TROUBLESHOOTING, SCRIPTING) already used the correct positional form; only this in-code hint was wrong. Now:Tests
profile_remove_drops_a_non_active_profileprofile_remove_refuses_missing_active_and_onlyGate
cargo fmt --check,clippy --all-targets --all-features -D warnings,clippy --no-default-features, andcargo testin both feature modes — all green.