-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parser for input command arguments (The Forward Slash PR) #2064
Conversation
Thanks for the question @stkerr Back in the days (a year ago 😂) we had a lengthy discussion on the separator and the slash was choses because the contexts/menus structure resembles the folder tree. The use case would be to jump into contexts and menus from the root of the terminal as if calling a command from a nested folder in a shell.
The options that we had on the table were slash Having a custom arbitrary separator ( |
Hey folks! I've added a few fixes and updated this PR so it's ready to merge once the tests pass. After the merge it would be great to look into enabling loading of portfolio files from arbitrary paths #1974 |
Problem:
Our input parsing behaves incorrectly when there is a forward slash in the command queue.
It is known to affect unix style paths and sorting arguments for screeners.
There are issues reporting this and PRs proposing fixes.
#1620
#2119
#1634
#1713
#2068
#1974
Solution:
This PR introduces a filtering function that searches for paths and special arguments and replaces them with placeholders for the time it is splitting the input into individual commands.
This should resolve the problem of unix paths or github repo names to be considered individual commands.
Along with the fix this PR introduces the following rules:
-f
argument is reserved for file paths-f
or--file
argument is mandatoryload /mydir/myfile.xls/ta/ema
<- will NOT workload -f /mydir/myfile.xls/ta/ema
<- will workCustom per-controller argument filters allow parsing edge cases in specific controllers. For example in
alternative/oss
this:sh openbb-finance/openbbterminal/../covid
<- will workLinting:
To support the rules a linter is added to the pre-commit hooks that checks that the short reserved command arguments are used with correct long command arguments
Additional fixes: