Coder Social home page Coder Social logo

giosh's People

Contributors

g1eng avatar

Watchers

 avatar

giosh's Issues

The shell panics on unterminated pipeline with a pipe |

Now giosh officially supports pipe, but a pipe with an unterminated line does not provide any errors and panics on the exexcution.

$ ./giosh 
@G[1]> ls -l | 
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/g1eng/giosh/shell.(*CommandLine).parseStatement(0xc000141cf8, 0x1, 0x6a1fa3)
        /home/suzume/local/Go/giosh/shell/parse_statement.go:23 +0x313
github.com/g1eng/giosh/shell.(*CommandLine).Parse(0xc000141cf8, 0xc00018c000, 0x8)
        /home/suzume/local/Go/giosh/shell/parse.go:9 +0x152
github.com/g1eng/giosh/shell.(*CommandLine).Run(0xc000141cf8, 0x0, 0x5)
        /home/suzume/local/Go/giosh/shell/run.go:26 +0x2bc
github.com/g1eng/giosh/cmd.parseArgs(0xc00005e540, 0x0, 0x1)
        /home/suzume/local/Go/giosh/cmd/parseargs.go:37 +0x625
github.com/urfave/cli/v2.(*App).RunContext(0xc000015380, 0x6f98f0, 0xc00001e060, 0xc000012220, 0x1, 0x1, 0x0, 0x0)
        /home/suzume/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:322 +0x6fe
github.com/urfave/cli/v2.(*App).Run(...)
        /home/suzume/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:224
github.com/g1eng/giosh/cmd.Cmd()
        /home/suzume/local/Go/giosh/cmd/cmd.go:31 +0x2a8
main.main()
        /home/suzume/local/Go/giosh/main.go:8 +0x25

This should be fixed.

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.