cmdline: add listconfig/helpconfig
This commit is contained in:
@@ -358,6 +358,17 @@ class Commands:
|
|||||||
cv = self.config.cv.from_key(key)
|
cv = self.config.cv.from_key(key)
|
||||||
cv.set(value)
|
cv.set(value)
|
||||||
|
|
||||||
|
@command('')
|
||||||
|
async def listconfig(self):
|
||||||
|
"""Returns the list of all configuration variables. """
|
||||||
|
return self.config.list_config_vars()
|
||||||
|
|
||||||
|
@command('')
|
||||||
|
async def helpconfig(self, key, more=False):
|
||||||
|
"""Returns help about a configuration variable. """
|
||||||
|
cv = self.config.cv.from_key(key)
|
||||||
|
return cv.get_long_desc() if more else cv.get_short_desc()
|
||||||
|
|
||||||
@command('')
|
@command('')
|
||||||
async def make_seed(self, nbits=None, language=None, seed_type=None):
|
async def make_seed(self, nbits=None, language=None, seed_type=None):
|
||||||
"""Create a seed"""
|
"""Create a seed"""
|
||||||
@@ -1502,6 +1513,7 @@ command_options = {
|
|||||||
'from_ccy': (None, "Currency to convert from"),
|
'from_ccy': (None, "Currency to convert from"),
|
||||||
'to_ccy': (None, "Currency to convert to"),
|
'to_ccy': (None, "Currency to convert to"),
|
||||||
'public': (None, 'Channel will be announced'),
|
'public': (None, 'Channel will be announced'),
|
||||||
|
'more': (None, 'Return detailed description'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -242,6 +242,9 @@ class SimpleConfig(Logger):
|
|||||||
self.amt_precision_post_satoshi = self.BTC_AMOUNTS_PREC_POST_SAT
|
self.amt_precision_post_satoshi = self.BTC_AMOUNTS_PREC_POST_SAT
|
||||||
self.amt_add_thousands_sep = self.BTC_AMOUNTS_ADD_THOUSANDS_SEP
|
self.amt_add_thousands_sep = self.BTC_AMOUNTS_ADD_THOUSANDS_SEP
|
||||||
|
|
||||||
|
def list_config_vars(self) -> Sequence[str]:
|
||||||
|
return list(sorted(_config_var_from_key.keys()))
|
||||||
|
|
||||||
def electrum_path_root(self):
|
def electrum_path_root(self):
|
||||||
# Read electrum_path from command line
|
# Read electrum_path from command line
|
||||||
# Otherwise use the user's default data directory.
|
# Otherwise use the user's default data directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user