mirror of https://github.com/nucypher/nucypher.git
Introduces 'nucypher --config' for fast access to default configuration filepaths.
parent
891e5541d6
commit
e81a6167b4
|
@ -17,12 +17,27 @@ along with nucypher. If not, see <https://www.gnu.org/licenses/>.
|
|||
|
||||
import click
|
||||
|
||||
from nucypher.cli.commands import alice, bob, dao, enrico, felix, multisig, stake, status, ursula, worklock, cloudworkers
|
||||
from nucypher.cli.painting.help import echo_version
|
||||
from nucypher.cli.commands import (
|
||||
alice,
|
||||
bob,
|
||||
dao,
|
||||
enrico,
|
||||
felix,
|
||||
multisig,
|
||||
stake,
|
||||
status,
|
||||
ursula,
|
||||
worklock,
|
||||
cloudworkers
|
||||
)
|
||||
from nucypher.cli.painting.help import echo_version, echo_config_location
|
||||
|
||||
|
||||
@click.group()
|
||||
@click.option('--version', help="Echo the CLI version", is_flag=True, callback=echo_version, expose_value=False, is_eager=True)
|
||||
@click.option('--version', help="Echo the CLI version",
|
||||
is_flag=True, callback=echo_version, expose_value=False, is_eager=True)
|
||||
@click.option('--config', help="Echo the configuration and log directory locations",
|
||||
is_flag=True, callback=echo_config_location, expose_value=False, is_eager=True)
|
||||
def nucypher_cli():
|
||||
"""Top level command for all things nucypher."""
|
||||
|
||||
|
@ -65,8 +80,8 @@ ENTRY_POINTS = (
|
|||
status.status, # Network Status
|
||||
felix.felix, # Faucet
|
||||
multisig.multisig, # MultiSig operations
|
||||
worklock.worklock, # WorkLock
|
||||
cloudworkers.cloudworkers #Remote Worker node management
|
||||
worklock.worklock, # WorkLock
|
||||
cloudworkers.cloudworkers # Remote Worker node management
|
||||
)
|
||||
|
||||
for entry_point in ENTRY_POINTS:
|
||||
|
|
|
@ -19,6 +19,7 @@ import click
|
|||
|
||||
from nucypher.blockchain.eth.sol.__conf__ import SOLIDITY_COMPILER_VERSION
|
||||
from nucypher.characters.banners import NUCYPHER_BANNER
|
||||
from nucypher.config.constants import DEFAULT_CONFIG_ROOT, USER_LOG_DIR
|
||||
|
||||
|
||||
def echo_version(ctx, param, value):
|
||||
|
@ -35,6 +36,12 @@ def echo_solidity_version(ctx, param, value):
|
|||
ctx.exit()
|
||||
|
||||
|
||||
def echo_config_location(ctx, param, value):
|
||||
if not value or ctx.resilient_parsing:
|
||||
return
|
||||
click.secho(f"{DEFAULT_CONFIG_ROOT}\n{USER_LOG_DIR}")
|
||||
ctx.exit()
|
||||
|
||||
def paint_new_installation_help(emitter, new_configuration):
|
||||
character_config_class = new_configuration.__class__
|
||||
character_name = character_config_class.NAME.lower()
|
||||
|
|
Loading…
Reference in New Issue