Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Conversation

@reneengelhard
Copy link
Contributor

Hi,

while discussing #1453 and the implications of fixing it we thought it would make sense to move from our custom flag parsing to use 'cli' - as etcd already does.

Due to some difficulties and big(ger) restructuring needs of (test) code it took longer than anticipated, but here it is.

Passes the unit and functional tests. I rebased it upto current master so it includes the new
--replace switch, too

Regards,

Rene

- rework option parsing
- move away from (most) global variables (cAPI), keep currentCommand for now...
- we need to pass c (the cli context) and cAPI (the client API) around

Signed-off-by: Olaf Buddenhagen <[email protected]>
@tixxdz
Copy link
Contributor

tixxdz commented Apr 26, 2016

@reneengelhard @antrik thanks for the work!

So if tests pass, we need some lgtm here, will review it later. If of course there are no backward incompatibilities this should go in.

Thanks again!

@jonboulle
Copy link
Contributor

nack, if you're going to move to a library can you please make it cobra
instead? https://github.com/coreos/docs/tree/master/golang#cli

We used to use codegangsta in fleet and moved away from it. If you look
into etcd a little deeper, it should only be using cli for some old
commands, and all the latest stuff should be using cobra.

On Tue, Apr 26, 2016 at 3:44 PM, Rene Engelhard [email protected]
wrote:

Hi,

while discussing #1453 #1453 and
the implications of fixing it we thought it would make sense to move from
our custom flag parsing to use 'cli' - as etcd already does.

Due to some difficulties and big(ger) restructuring needs of (test) code
it took longer than anticipated, but here it is.

Passes the unit and functional tests. I rebased it upto current master so
it includes the new
--replace switch, too

Regards,

Rene

You can view, comment on, or merge this pull request online at:

#1570
Commit Summary

  • Godeps: add github.com/codegangsta/cli
  • move to cli

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1570

@tixxdz
Copy link
Contributor

tixxdz commented Apr 27, 2016

@jonboulle just in time, alright.

@tixxdz tixxdz closed this Apr 28, 2016
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 13, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* do not pass around cAPI all the time, but create a parameter API for
  each run command, to wrap around cases from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 13, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* do not pass around cAPI all the time, but create a parameter API for
  each run command, to wrap around cases from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 14, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* do not pass around cAPI all the time, but create a parameter API for
  each run command, to wrap around cases from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 14, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 14, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 14, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 14, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 17, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 17, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to endocode/fleet that referenced this pull request May 19, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to endocode/fleet that referenced this pull request May 19, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* create a parameter API for each run command, to wrap around cases
  from different contexts.
* create a wrapper runWrapper() to be used for cobra.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 20, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* Create a wrapper runWrapper() to be used for cobra, to wrap around
  a normal run*() function into a prototype for cobra.Command.Run().
  It also sets a global variable cAPI for running a normal command.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request May 20, 2016
Use Cobra (github.com/spf13/cobra) instead of cli
(github.com/codegangsta/cli), for better cmdline user interface.

* Create a wrapper runWrapper() to be used for cobra, to wrap around
  a normal run*() function into a prototype for cobra.Command.Run().
  It also sets a global variable cAPI for running a normal command.
* remove unnecessary code for codegangsta/cli from fleetctl.go.

Suggested-by: Jonathan Boulle <[email protected]>
Fixes: coreos#1453
Supersedes coreos#1570
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants