Commit 5d39ed58 authored by André Anjos's avatar André Anjos 💬
Browse files

Fix defaults display; Python syntax; Docs

parent 214eb54b
Pipeline #19648 failed with stages
in 26 minutes and 49 seconds
......@@ -187,6 +187,11 @@ class Configuration(object):
indent=4, separators=(',', ': '))
def as_dict(self):
return copy.copy(self.__data)
def __getattr__(self, key):
return self.__data[key]
......
......@@ -70,8 +70,6 @@ Commands:
experiments | xp Actions related to experiments
See 'beat <command> --help' for more information on a specific command.
N.B.: The values of options "prefix", "cache" "user", "token", "platform" and
"""
import os
......@@ -104,15 +102,15 @@ def main(user_input=None):
else:
arguments = sys.argv[1:]
from ..config import DEFAULTS
prog = os.path.basename(sys.argv[0])
completions = dict(
prog=prog,
version=__version__,
**DEFAULTS,
)
from ..config import Configuration
completions.update(Configuration({}).as_dict())
args = docopt(
__doc__ % completions,
argv=arguments,
......
......@@ -57,19 +57,43 @@ that directory, do the following from your shell:
You can verify your username and token have been memorized on that working
directory with:
.. command-output:: beat config list
.. command-output:: beat config show
By default, the command-line program considers your current working directory
(i.e. ``.``), as your prefix. You can set another prefix using the ``--prefix``
flag:
By default, the command-line program considers the ``prefix`` directory on your
current working directory as your prefix. You can override this setting using the
``--prefix`` flag:
.. code-block:: sh
$ ./bin/beat --prefix=/Users/myname/work/beat config list
$ ./bin/beat --prefix=/Users/myname/work/beat config show
...
Local Overrides
===============
If you use the ``config set`` flag ``--local``, then the configuration values
are not set on the default configuration file (``~/.beatrc``), but instead in
the **current** working directory (``./.beatrc``). Configuration values found
on the local directory take **precedence** over values configured on the global
file. Values from the command-line (such as those passed with ``--prefix`` as
explained above) take precedence over both settings.
You can set a variable on the local directory to override the global settings
like this:
.. code-block:: sh
# set a different prefix when operating from the current directory
$ ./bin/beat config set --local prefix `pwd`/other_prefix
$ ./bin/beat config show
...
Database Root Directories
=========================
When running an experiment via the ``beat`` application using the local
executor (the default executor, also behind the ``--local`` flag), ``beat``
will look into your configuration for any options set by the user that follow
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment