Commit Graph

10 Commits

Author SHA1 Message Date
dr.max 47a10c079d Remove fmt.Printf of error since creates double error print to user (#96)
Fixes issue #89
2019-05-10 11:54:38 -07:00
dr.max 7c4f05aa6b adding hack/build* to make life easy and added version command. Getting my feet wet (#69) 2019-04-15 15:51:01 -07:00
Kenjiro Nakayama e8ec699d2c Add SilenceUsage option to cobra command (#43)
* Add SilenceUsage option to cobra command

This patch adds `cmd.SilenceUsage` to command to stop usage output
after command validation.

Fixes https://github.com/knative/client/issues/38

* Set cmd.SilenceUsage to global cmd
2019-03-29 12:07:53 -07:00
Kenjiro Nakayama 72ec64390b Fix flag parse error by calling flag.Parse first (#42)
* Fix flag parse error by calling flag.Parse

Fixes https://github.com/knative/client/issues/37

* Fix workaround for parse error
2019-03-29 04:34:53 -07:00
Kenjiro Nakayama c07254c46d Support generating bash completion (#31)
* Support generating bash completion

This patch adds subcommand to generate completion script for bash.

As an knative user, we would like to complete subcommands and
options rather than typing them.

* Adds docs about bash auto completion in README.md

This changeset adds auto-completion section in existing README.md

Suggested-by: Navid Shaikh <nshaikh@redhat.com>
2019-03-18 22:31:05 -07:00
Timur Zununbekov be50567b38 Pickup config path from env (#27) 2019-03-14 13:47:08 -07:00
Navid Shaikh 139db6c4f9 Fixes typo in the kn help command (#24)
s/blokcs/blocks

 and removes few unneeded dots (.)
2019-02-25 14:49:19 -08:00
Nima Kaviani ad636ad789 add revision describe (#15) (#16)
* put the auth libraries in the root command

* add revision describe (#15)

* print the yaml formatted revision by default
* allow for custom formatting to be passed in
2019-02-01 15:23:13 -08:00
Naomi Seyfer 7cc59481bb
Refactor to allow testing; write first tests. (#10)
* Refactor commands to allow insertion of fakes for testing

* Pin client-go to version that matches signatures other libs use

* Add tests for service list

* actually add test file

* Review comments: Fatal instead of Error/return, Split instead of read to newline
2019-01-29 12:40:22 -08:00
Naomi Seyfer 38932b1d61
Get revision and service listing skeletons in. (#2)
* Get revision and service listing skeletons in.

This adds the kn program, with basic commands for service and revision listing
in.

kn service list
kn revision list

They use the genericclioptions library from kubernetes to support jsonpath,
yaml, and json output. The default is to just list the names of the objects, for
now, until we add in some of the kubectl-based libraries for creating tables in
another commit.

This is deliberately bare-bones; I am looking to get the basic skeletons of how
this repository is laid out down.

No tests yet. Soon.

* Move commands to pkg, so cmd only contains minimalist main.go

* RunE instead of Run. The defaults on Cobra command generation are weird.

* Oops forgot to change types of stuff

* Do not panic on bad config file

* Make commands no longer global

* Make configuration initialization not static in the module, but rather triggered by main.go init
2019-01-22 09:03:58 -08:00