Allow adding multiple tickers via CLI
parent
ec2884a556
commit
7aa99019cb
|
@ -206,11 +206,12 @@ def load(ctx, data):
|
||||||
|
|
||||||
@watchlists.command(help='add ticker to watchlist')
|
@watchlists.command(help='add ticker to watchlist')
|
||||||
@click.argument('name', nargs=1, required=True)
|
@click.argument('name', nargs=1, required=True)
|
||||||
@click.argument('ticker_name', nargs=1, required=True)
|
@click.argument('ticker_names', nargs=-1, required=True)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def add(ctx, name, ticker_name):
|
def add(ctx, name, ticker_names):
|
||||||
watchlist = wl.add_ticker(name, ticker_name,
|
for ticker in ticker_names:
|
||||||
ctx.obj['watchlist'])
|
watchlist = wl.add_ticker(
|
||||||
|
name, ticker, ctx.obj['watchlist'])
|
||||||
wl.write_to_file(watchlist, ctx.obj['path'])
|
wl.write_to_file(watchlist, ctx.obj['path'])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue