--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
|
@ -10,8 +10,9 @@ git-annex (7.20191231) UNRELEASED; urgency=medium
|
|||
when foo=yes is expected.
|
||||
* initremote, enableremote: Reject unknown configuration parameters
|
||||
provided to these commands.
|
||||
* initremote: Added --describe-other-params option, to show additional
|
||||
configuration parameters you might want to set.
|
||||
* initremote: Added --whatelse option, to show additional
|
||||
configuration parameters you might want to set. Eg:
|
||||
git annex initremote type=directory encryption=none --whatelse
|
||||
* Added LISTCONFIGS to external special remote protocol. Special remote
|
||||
programs that use GETCONFIG/SETCONFIG are recommended to implement it.
|
||||
|
||||
|
|
|
@ -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)) $
|
||||
|
|
|
@ -21,7 +21,7 @@ The remote's configuration is specified by the parameters passed
|
|||
to this command. Different types of special remotes need different
|
||||
configuration values, so consult the documentation of a special remote for
|
||||
details. The command will prompt for any required parameters you leave out;
|
||||
you can also pass --describe-other-params to see additional parameters.
|
||||
you can also pass --whatelse to see additional parameters.
|
||||
|
||||
A few parameters that are supported by all special remotes are documented in
|
||||
the next section below.
|
||||
|
@ -38,14 +38,14 @@ want to use `git annex renameremote`.
|
|||
|
||||
# OPTIONS
|
||||
|
||||
* `--describe-other-params` / `-p`
|
||||
* `--whatelse` / `-w`
|
||||
|
||||
Describe additional configuration parameters that you could specify.
|
||||
|
||||
For example, if you know you want a S3 remote, but forget how to
|
||||
configure it:
|
||||
|
||||
git annex initremote mys3 type=S3 --describe-other-params
|
||||
git annex initremote mys3 type=S3 --whatelse
|
||||
|
||||
* `--fast`
|
||||
|
||||
|
@ -88,7 +88,7 @@ want to use `git annex renameremote`.
|
|||
|
||||
For details about this and other encrpytion settings, see
|
||||
<https://git-annex.branchable.com/encryption/>
|
||||
or --describe-other-params
|
||||
or --whatelse
|
||||
|
||||
* `autoenable`
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ and indeed I get asked for e.g. encryption to be explicitly specified (why not t
|
|||
[[!meta author=yoh]]
|
||||
[[!tag projects/datalad]]
|
||||
|
||||
> [[done]] as eg `git annex initremote type=rsync --describe-other-params`.
|
||||
> [[done]] as eg `git annex initremote type=rsync --whatelse`.
|
||||
>
|
||||
> External special remotes that implement LISTCONFIGS can also be queried:
|
||||
>
|
||||
> git annex inittype type=external externaltype=foo --describe-other-params
|
||||
> git annex inittype type=external externaltype=foo --whatelse
|
||||
|
|
Loading…
Reference in a new issue