Code Monkey home page Code Monkey logo

Comments (8)

pouriyajamshidi avatar pouriyajamshidi commented on July 17, 2024 1

got it sorry for over complicating things..

thanks to @luca-patrignani the issue is resolved

Not a problem at all mate. I am grateful for your contributions!

from tcping.

wizsk avatar wizsk commented on July 17, 2024

hi @pouriyajamshidi
Thanks for the mention 😃.
Can you please describe the func?

from tcping.

pouriyajamshidi avatar pouriyajamshidi commented on July 17, 2024

Hi @wizsk,

I am willing to hear your proposal to modify the permuteArgs func. If it proves to be a small change, we can forfeit moving to Cobra for now and save us some work.

from tcping.

wizsk avatar wizsk commented on July 17, 2024

ok @pouriyajamshidi I will let you know

from tcping.

wizsk avatar wizsk commented on July 17, 2024

hey @pouriyajamshidi
Why can't we do something like this?

	// arg 1 and 2 is reserved for url and port
	url := os.Args[1]
	port := os.Args[2]

	// we can parse the rest
	os.Args = os.Args[2:]
	flag.Parse()

I'm ignoring the error handling
for the -u flag we can add some extra logic

from tcping.

wizsk avatar wizsk commented on July 17, 2024

You want to preserve this functionality

		{
			"host/ip before option",
			args{args: []string{"127.0.0.1", "8080", "-r", "3"}},
			[]string{"-r", "3", "127.0.0.1", "8080"},
		},
		{
			"host/ip after option",
			args{args: []string{"-r", "3", "127.0.0.1", "8080"}},
			[]string{"-r", "3", "127.0.0.1", "8080"},
		}

this is why everything is getting all over the place

from tcping.

pouriyajamshidi avatar pouriyajamshidi commented on July 17, 2024

well, to be frank, that is how all other OS utilities work. The order in which you provide the flags never matters.

from tcping.

wizsk avatar wizsk commented on July 17, 2024

got it sorry for over complicating things..

thanks to @luca-patrignani the issue is resolved

from tcping.

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.