From 5c6bf1be97de7537df4f19c881fd310b4657989b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Jan 2020 17:04:45 -0400 Subject: [PATCH] --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? --- CHANGELOG | 5 +++-- Command/InitRemote.hs | 8 ++++---- doc/git-annex-initremote.mdwn | 8 ++++---- ...t_of_options_for_a_special_remote_of_a_given_type.mdwn | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1654fbc1ea..4b58b99929 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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. diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs index b4c431743f..d601e39c54 100644 --- a/Command/InitRemote.hs +++ b/Command/InitRemote.hs @@ -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)) $ diff --git a/doc/git-annex-initremote.mdwn b/doc/git-annex-initremote.mdwn index 5921390136..ca204eac7f 100644 --- a/doc/git-annex-initremote.mdwn +++ b/doc/git-annex-initremote.mdwn @@ -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 - or --describe-other-params + or --whatelse * `autoenable` diff --git a/doc/todo/some_way_to_get_a_list_of_options_for_a_special_remote_of_a_given_type.mdwn b/doc/todo/some_way_to_get_a_list_of_options_for_a_special_remote_of_a_given_type.mdwn index 493e7430f3..bcc9dc9ff2 100644 --- a/doc/todo/some_way_to_get_a_list_of_options_for_a_special_remote_of_a_given_type.mdwn +++ b/doc/todo/some_way_to_get_a_list_of_options_for_a_special_remote_of_a_given_type.mdwn @@ -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