Giter Club home page Giter Club logo

Comments (3)

fvbock avatar fvbock commented on July 3, 2024

i believe this is due to when/where/how you call flag.Parse()

endless allows other flags to be defined, preserves them, and appends its own at the end.

have a look here: https://gist.github.com/fvbock/855a980deed441cc31cd

if you compile and run that:

$ go build -o flags flags.go
$ ./flags -paramA pValA -paramB
2015/06/30 14:55:15 Got passed: [-paramA pValA -paramB]  # this is from os.Args[1:]
2015/06/30 14:55:15 paramA pValA
2015/06/30 14:55:15 paramB true
2015/06/30 14:55:16 22335 localhost:4242

Now send SIGHUP

$ kill -1 22335

2015/06/30 14:55:30 22335 Received SIGHUP. forking.
2015/06/30 14:55:30 Got passed: [-paramA pValA -paramB -continue]
2015/06/30 14:55:30 paramA pValA
2015/06/30 14:55:30 paramB true
2015/06/30 14:55:30 22351 localhost:4242

the original parameters are kept and endless appends it's own parameters at the end.

does this help?

from endless.

 avatar commented on July 3, 2024

When I posted the issue, it briefly crossed my mind that it might be a library interaction, but the lateness of the hour left me too lazy to test it.

It turns out that this is an interaction between endless and my favorite drop-in flag parsing library by namsral. Try this code and the pattern fails. Use the Go standard flag library and it succeeds.

I don't yet know in which library the issue lies, so I'll withdraw the ticket until I can investigate further.

Thanks for the speedy and civil response.

from endless.

 avatar commented on July 3, 2024

Really closed. This is not an endless issue. For the curious, this can be followed in namsral/flag.

from endless.

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.