Require `<symbol>.<provider>` format to cli

symbol_search
Tyler Goodlet 2021-05-19 08:36:40 -04:00
parent c9311dd7d0
commit 2471ce446e
2 changed files with 10 additions and 1 deletions

View File

@ -1638,8 +1638,10 @@ async def _async_main(
)
chart_app.search = search
symbol, _, provider = sym.rpartition('.')
# this internally starts a ``chart_symbol()`` task above
chart_app.load_symbol(brokernames[0], sym, loglevel)
chart_app.load_symbol(provider, symbol, loglevel)
# TODO: seems like our incentive for brokerd caching lelel
backends = {}

View File

@ -138,6 +138,13 @@ def chart(config, symbol, profile, pdb):
from .. import _profile
from ._chart import _main
if '.' not in symbol:
click.echo(click.style(
f'symbol: {symbol} must have a {symbol}.<provider> suffix',
fg='red',
))
return
# toggle to enable profiling
_profile._pg_profile = profile