Comments (9)
Can I suggest the smaller fix catch the error and throw something meaningful be given a higher priority. I wasted way more time trying to figure out what was happing then a simple space in a file deserved. In fact since this was lets give it a try and see if it looks like it is worth more time to dive deeper into it's functionality and I am only giving myself 2 hours to play before I move on, test drive. I almost walked away.
from typedb-console.
@tomassabat this is a common bug in any terminal application. Have you tried escaping the space character with backslash?
@lriuui0x0 do you know if we can quote the source filename to not need escaping any characters?
from typedb-console.
@haikalpribadi Yes I believe so, see the escape before the space at the end of the filepath: ...2.0\ .gql
. This is added automatically when I drag and drop a file into the terminal. Putting the file path in quotes also throws the same error, like so:
source "/Users/tasabat/Desktop/Financial-Knowledge-Graph-2.0 .gql"
However, in 1.8 the file path (with the same escape) does work:
./grakn console -k 'test' -f /Users/tasabat/Desktop/Financial-Knowledge-Graph-2.0\ .gql
from typedb-console.
@haikalpribadi @tomassabat The current command line argument processing is very rudimentary, which only deals with arguments without spaces in it. If we want to implement the quoting or escape characters, we need to implement a parser of the command line arguments.
from typedb-console.
Okay then let's leave this in backlog for now, @lriuui0x0 - but can we provide a better error message? Also I'm confused: why does the error message Graql error? and why does it look like it uses ANTLR?
@tomassabat for now just please make sure to not have spaces in file names for now.
from typedb-console.
Will do thanks @haikalpribadi
from typedb-console.
I'm cleaning this up in #150 @JRWest2000 @tomassabat , at least the error message is then obvious!
from typedb-console.
@haikalpribadi Sorry for the late reply, the reason used to be we check for a command by the first token and the number of arguments. So in this case the first token is source
but it has three tokens in total, which is different from two tokens it expects, so it thought it was not a source command but fallback to graql query.
This behaviour seems have already been improved by @flyingsilverfin
from typedb-console.
Ah, I see. That logic is flawed, @lriuui0x0 . Once you know the first token, you should route it a different decision tree. Every initial tokens are unique commands, so you don't need to fall back to a different logic once they are identified. Further parsing of the number of arguments following that token should be done independently, which would allow you to provide better error message.
from typedb-console.
Related Issues (20)
- TypeDB Cluster management HOT 2
- User role management
- Distribution JARs must be uniquely identified by their Maven coordinates HOT 1
- Log a warning if the current locale does not support all Unicode characters
- Allow multi-line query in Console scripts
- Connection error when querying TypeDB Cluster database schema HOT 1
- Defining concepts Type does not exist HOT 3
- 'source' commands on windows crash on exception
- "Missing credential" error is not user-friendly (connecting to TypeDB Cluster without correct args) HOT 1
- Support multiple layers of abstract commands
- Export schema in a file without unnecessary lines HOT 1
- Session not disconnected after a password change resulting in an Exception. HOT 1
- Confirm a password change before updating a user's password
- Wildcard support
- Greek characters/vaticle HOT 1
- Termination of commands and TypeQL queries is better to be consistent
- Respect default port when connecting by IP/domain name only
- Uncaught exception with Ctrl+C instead of input on password update
- Password-update command is redundant and behaves inconsistently to password-set HOT 1
- Confirmation prompt before deleting a database
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typedb-console.