//! `rightkit-swap A B`: atomically exchanges two paths with `renamex_np(RENAME_SWAP)` or fails.
//!
//! Used by `right-release install-app` so an installed app bundle is never absent, even under
//! SIGKILL. On failure it writes one line to stderr and exits nonzero.
//! Exit: 0 swapped, 1 I/O (missing path, permissions, ...), 2 usage or invalid path,
//! 3 swap unsupported here (non-APFS volume or non-macOS; callers fall back to two renames).
use is_swap_unsupported;
use swap_paths;
use OsString;
use Path;
use ExitCode;