Git Product home page Git Product logo

cmd's People

Contributors

dylanhitt avatar simonbaeumer avatar thomasnemer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmd's Issues

How to deal with space in path when execute command in windows?

For example:

Ex.1

c := cmd.NewCommand(`"C:\Program Files\Java\jre1.8.0_192\bin\java.exe" --version`)
    _ = c.Execute()
    fmt.Println(c.Stdout())
    fmt.Println(c.Stderr())
'\"C:\Program Files\Java\jre1.8.0_192\bin\java.exe\"' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

Plz focus on the path string. And I don't know why \" instead of "

Ex.2

c := cmd.NewCommand(`C:\Program Files\Java\jre1.8.0_192\bin\java.exe --version`)
    _ = c.Execute()
    fmt.Println(c.Stdout())
    fmt.Println(c.Stderr())
'C:\Program' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

Ex.1 and Ex.2 can solve by define the workingDir

Ex.3

When some problem need an arguments with a windows style file with space, the error occurs.
And I didn't find the way to solve it.

Plz help~

Add ability to override base command

It would be great to be able to override the base command. In my case, I'd like to have the ability to run linux commands on a remote server (via ssh) and at the moment that is not possible.

Timeouts should return an error code of non-zero

In the case of the process of the command timing out we will respect its error code, but in the case of when we elect to timeout and kill the command what should we do.

There's a case for returning a 124 to signal timeout or get the SIGTERM exit code of 143. I'm not quite sure I have a good opinion on either, but we need to remember we return an error the client describing that we timed out. In either case the client would be able to verify the code.

Also another option is to return a completely irrelevant code like -1 just as long as it's non zero

Repo cleaning

  • Add commitlint
  • markdownlint
  • Add staticcheck
  • Remove todo in readme
  • Update readme I.e install should target main/latest
  • Add contributing blurb to readme
    • encourage submitting an issue/opening a PR
    • open PR for simple fixes, open an issue in the case of features and let's discuss
    • getting started. I.e run make init if you want pre commit hooks. Testing ensure change/feature works on osx, Linux and windows
  • migrate to main

Analyse stdcopy:94

Analyse the stdcopy.Stdcopy package from docker:
github.com/docker/docker/pkg/stdcopy/stdcopy.go:94

It could demultiplex a multiplexed stream written to stdout and stderr

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.