Coder Social home page Coder Social logo

Request for `-L` option about smug HOT 5 OPEN

ivaaaan avatar ivaaaan commented on May 25, 2024
Request for `-L` option

from smug.

Comments (5)

ivaaaan avatar ivaaaan commented on May 25, 2024 1

Thanks for the suggestion. I don't have much time to work on it myself, but if you have a desire to work on this I will help you with anything. Feel free to reach out, my email is in the profile.

from smug.

ivaaaan avatar ivaaaan commented on May 25, 2024

@juboba have you started working on this? I got some free time and thinking about implementing this, or I can help you. Let me know if you have any progress

from smug.

dufferzafar avatar dufferzafar commented on May 25, 2024

@ivaaaan I was looking at the code, and I think this could be implemented in the Exec functions of commander.go where we would add the -L / -S socket details to cmd.Args before running a command:

smug/commander.go

Lines 28 to 57 in d053a9d

func (c DefaultCommander) Exec(cmd *exec.Cmd) (string, error) {
if c.logger != nil {
c.logger.Println(strings.Join(cmd.Args, " "))
}
output, err := cmd.CombinedOutput()
if err != nil {
if c.logger != nil {
c.logger.Println(err)
}
return "", &ShellError{strings.Join(cmd.Args, " "), err}
}
return strings.TrimSuffix(string(output), "\n"), nil
}
func (c DefaultCommander) ExecSilently(cmd *exec.Cmd) error {
if c.logger != nil {
c.logger.Println(strings.Join(cmd.Args, " "))
}
err := cmd.Run()
if err != nil {
if c.logger != nil {
c.logger.Println(err)
}
return &ShellError{strings.Join(cmd.Args, " "), err}
}
return nil
}

The -L / -S options could be passed to the commander instance from main.go:

smug/main.go

Line 81 in d053a9d

commander := DefaultCommander{logger}

Does that seem right?

from smug.

ivaaaan avatar ivaaaan commented on May 25, 2024

@dufferzafar sounds good. Feel free to create a PR, I'll take a look at it :)

from smug.

aswadsun avatar aswadsun commented on May 25, 2024

Hi all, any progress on this feature?

Thanks,
Aswad

from smug.

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.