Giter Club home page Giter Club logo

Comments (9)

JRWest2000 avatar JRWest2000 commented on May 23, 2024 1

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.

haikalpribadi avatar haikalpribadi commented on May 23, 2024

@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.

tomassabat avatar tomassabat commented on May 23, 2024

@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.

lriuui0x0 avatar lriuui0x0 commented on May 23, 2024

@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.

haikalpribadi avatar haikalpribadi commented on May 23, 2024

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.

tomassabat avatar tomassabat commented on May 23, 2024

Will do thanks @haikalpribadi

from typedb-console.

flyingsilverfin avatar flyingsilverfin commented on May 23, 2024

I'm cleaning this up in #150 @JRWest2000 @tomassabat , at least the error message is then obvious!

from typedb-console.

lriuui0x0 avatar lriuui0x0 commented on May 23, 2024

@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.

haikalpribadi avatar haikalpribadi commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.