mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-01 23:12:21 +00:00
Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
This commit is contained in:
@@ -89,10 +89,14 @@ def check_path(path: str) -> str:
|
||||
str:
|
||||
Ratio of similarity between two strings
|
||||
"""
|
||||
# Just return empty path because this will be handled outside this function
|
||||
if not path:
|
||||
return ""
|
||||
# Return string of path if such path exists
|
||||
if os.path.isfile(path):
|
||||
return path
|
||||
logger.error("Expected list of one axis item.")
|
||||
console.print("The path file provided does not exist.\n[/red]")
|
||||
logger.error("The path file '%s' does not exist.", path)
|
||||
console.print(f"[red]The path file '{path}' does not exist.\n[/red]")
|
||||
return ""
|
||||
|
||||
|
||||
|
||||
11
terminal.py
11
terminal.py
@@ -304,6 +304,13 @@ class TerminalController(BaseController):
|
||||
"""Process exe command"""
|
||||
# Merge rest of string path to other_args and remove queue since it is a dir
|
||||
other_args += self.queue
|
||||
|
||||
if not other_args:
|
||||
console.print(
|
||||
"[red]Provide a path to the routine you wish to execute.\n[/red]"
|
||||
)
|
||||
return
|
||||
|
||||
full_input = " ".join(other_args)
|
||||
if " " in full_input:
|
||||
other_args_processed = full_input.split(" ")
|
||||
@@ -317,7 +324,8 @@ class TerminalController(BaseController):
|
||||
if path_dir in ("-i", "--input"):
|
||||
args = [path_routine[1:]] + other_args_processed[idx:]
|
||||
break
|
||||
path_routine += f"/{path_dir}"
|
||||
if path_dir not in ("-p", "--path"):
|
||||
path_routine += f"/{path_dir}"
|
||||
|
||||
if not args:
|
||||
args = [path_routine[1:]]
|
||||
@@ -335,6 +343,7 @@ class TerminalController(BaseController):
|
||||
dest="path",
|
||||
default="",
|
||||
type=check_path,
|
||||
required="-h" not in args,
|
||||
)
|
||||
parser_exe.add_argument(
|
||||
"-i",
|
||||
|
||||
Reference in New Issue
Block a user