Conversation
- 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 <olaf@endocode.com>
161ef0f to
c56d5e1
Compare
|
@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! |
|
nack, if you're going to move to a library can you please make it cobra We used to use codegangsta in fleet and moved away from it. If you look On Tue, Apr 26, 2016 at 3:44 PM, Rene Engelhard notifications@github.com
|
|
@jonboulle just in time, alright. |
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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 <jonathanboulle@gmail.com> Fixes: coreos#1453 Supersedes coreos#1570
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