showStart variant for when there's no worktree file

Clean up some uses of showStart with "" for the file,
or in some cases, a non-filename description string. That would
generate bad json, although none of the commands doing that
supported --json.

Using "" for the file resulted in output like "foo  rest";
now the extra space is eliminated.

This commit was sponsored by Fernando Jimenez on Patreon.
This commit is contained in:
Joey Hess 2017-11-28 14:40:26 -04:00
parent d6d8f72957
commit 4781ca297b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
46 changed files with 74 additions and 67 deletions

View file

@ -97,7 +97,7 @@ genAddresses addrs = do
-- Address is read from stdin, to avoid leaking it in shell history.
linkRemote :: RemoteName -> CommandStart
linkRemote remotename = do
showStart "p2p link" remotename
showStart' "p2p link" (Just remotename)
next $ next promptaddr
where
promptaddr = do
@ -123,7 +123,7 @@ linkRemote remotename = do
startPairing :: RemoteName -> [P2PAddress] -> CommandStart
startPairing _ [] = giveup "No P2P networks are currrently available."
startPairing remotename addrs = do
showStart "p2p pair" remotename
showStart' "p2p pair" (Just remotename)
ifM (liftIO Wormhole.isInstalled)
( next $ performPairing remotename addrs
, giveup "Magic Wormhole is not installed, and is needed for pairing. Install it from your distribution or from https://github.com/warner/magic-wormhole/"