mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Accept stdin args for terminal.py
This commit is contained in:
@@ -82,6 +82,7 @@ def main():
|
||||
# Print first welcome message and help
|
||||
print("\nWelcome to Gamestonk Terminal 🚀\n")
|
||||
should_print_help = True
|
||||
parsed_stdin = False
|
||||
|
||||
# Loop forever and ever
|
||||
while True:
|
||||
@@ -90,8 +91,12 @@ def main():
|
||||
print_help(s_ticker, s_start, s_interval, b_is_stock_market_open())
|
||||
should_print_help = False
|
||||
|
||||
# Get input command from user
|
||||
if session and gtff.USE_PROMPT_TOOLKIT:
|
||||
# Get input command from stdin or user
|
||||
if not parsed_stdin and len(sys.argv) > 1:
|
||||
as_input = " ".join(sys.argv[1:])
|
||||
parsed_stdin = True
|
||||
print(f"{get_flair()}> {as_input}")
|
||||
elif session and gtff.USE_PROMPT_TOOLKIT:
|
||||
as_input = session.prompt(f"{get_flair()}> ", completer=completer)
|
||||
else:
|
||||
as_input = input(f"{get_flair()}> ")
|
||||
|
||||
Reference in New Issue
Block a user