--whatelse is a better name than --describe-other-params
The use case is basically the user having forgotten, so --help would be best, but it would be quite hard to include this in --help, since it may even have to spin up an external special remote program. I also considered --umm but typoed it the first time I tried it as --uum, and while memorable, it's too cutesy. --whatelse is good because it explicitly asks, what other params, besides the ones I've given?
This commit is contained in:
parent
55f596e9b4
commit
5c6bf1be97
4 changed files with 13 additions and 12 deletions
|
@ -33,7 +33,7 @@ cmd = command "initremote" SectionSetup
|
|||
data InitRemoteOptions = InitRemoteOptions
|
||||
{ cmdparams :: CmdParams
|
||||
, sameas :: Maybe (DeferredParse UUID)
|
||||
, describeOtherParams :: Bool
|
||||
, whatElse :: Bool
|
||||
}
|
||||
|
||||
optParser :: CmdParamsDesc -> Parser InitRemoteOptions
|
||||
|
@ -41,8 +41,8 @@ optParser desc = InitRemoteOptions
|
|||
<$> cmdParams desc
|
||||
<*> optional parseSameasOption
|
||||
<*> switch
|
||||
( long "describe-other-params"
|
||||
<> short 'p'
|
||||
( long "whatelse"
|
||||
<> short 'w'
|
||||
<> help "describe other configuration parameters for a special remote"
|
||||
)
|
||||
|
||||
|
@ -74,7 +74,7 @@ start o (name:ws) = ifM (isJust <$> findExisting name)
|
|||
(Logs.Remote.keyValToConfig Proposed ws)
|
||||
<$> readRemoteLog
|
||||
t <- either giveup return (findType c)
|
||||
if describeOtherParams o
|
||||
if whatElse o
|
||||
then startingCustomOutput (ActionItemOther Nothing) $
|
||||
describeOtherParamsFor c t
|
||||
else starting "initremote" (ActionItemOther (Just name)) $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue