Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shihyuho committed Dec 13, 2018
1 parent 7a25b6b commit 32ea2f6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,31 @@ $ slctl init --token GITHUB_TOKEN

## Plugins

Searching SoftLeader official plugin

```sh
$ slctl plugin search NAME
```

*NAME* 可傳入指定的 Plugin 名稱, 會視為模糊條件來過濾; 反之列出全部

```sh
$ slctl plugin search
$ slctl plugin search whereis
```

執行 `$ slctl plugin install SOURCE` 即可安裝, 點擊 [Installing a Plugin](https://github.com/softleader/slctl/wiki/Plugins-Guide#installing-a-plugin) 查看多種 *SOURCE* 的安裝方式

以下列出所有 Plugin 清單 (包含官方或個人貢獻的 Plugin)

- [softleader/slctl-whereis](https://github.com/softleader/slctl-whereis) - 快速查看同事現在在哪兒
- [softleader/slctl-make](https://github.com/softleader/slctl-make) - 在不同作業系統間都可以使用 GUN Make
- [softleader/slctl-contacts](https://github.com/softleader/slctl-contacts) - 查看公司通訊錄

### Upgrading Plugins

*Slctl* 支援 GitHub Plugin 自動更新, 請參考 [Upgrading Plugins](https://github.com/softleader/slctl/wiki/Plugins-Guide#upgrading-plugins)

### Writing Custom Plugins

*Slctl* 支援任何語言的 Plugin, 請參考 [Plugins Guide](https://github.com/softleader/slctl/wiki/Plugins-Guide)
Expand Down
5 changes: 3 additions & 2 deletions cmd/plugin_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import (
"strings"
)

const pluginSearchDesc = `收尋 SoftLeader 官方 Plugin
const pluginSearchDesc = `Search SoftLeader official plugin
$ slctl plugin search NAME
'NAME' 有給則以模糊查詢過濾; 反之沒給則列出全部
NAME 可傳入指定的 Plugin 名稱, 會視為模糊條件來過濾; 反之列出全部
$ slctl plugin search
$ slctl plugin search whereis
`

type pluginSearchCmd struct {
Expand Down
24 changes: 19 additions & 5 deletions cmd/plugin_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,22 @@ import (
"strings"
)

const pluginUpgradeDesc = `更新 Plugin, 只會更新 SOURCE 為 GitHub 的 Plugin
const pluginUpgradeDesc = `Upgrade plugin which installed from GitHub
$ slctl plugin upgrade NAME...
NAME 可傳入指定要更新的 Plugin 完整名稱 (一或多個, 以空白區隔); 反之更新全部
$ slctl plugin upgrade
$ slctl plugin upgrade slctl-whereis
傳入 '--tag' 可以指定要更新的 release 版本
$ slctl plugin upgrade slctl-whereis --tag 1.0.0
傳入 '--tag' 及 '--asset' 可以指定要更新的 release 版本以及要下載第幾個 asset 檔案 (從 0 開始)
$ slctl plugin upgrade slctl-whereis --tag 1.0.0 --asset 2
`

type pluginUpgradeCmd struct {
Expand All @@ -26,8 +39,8 @@ type pluginUpgradeCmd struct {
func newPluginUpgradeCmd(out io.Writer) *cobra.Command {
c := &pluginUpgradeCmd{out: out}
cmd := &cobra.Command{
Use: "upgrade NAME",
Short: "upgrade plugin from Source Github",
Use: "upgrade NAME...",
Short: "upgrade plugin which installed from GitHub",
Long: usage(pluginUpgradeDesc),
RunE: func(cmd *cobra.Command, args []string) error {
if environment.Settings.Offline {
Expand All @@ -41,8 +54,9 @@ func newPluginUpgradeCmd(out io.Writer) *cobra.Command {
},
}

cmd.Flags().StringVar(&c.tag, "tag", "", "specify a tag constraint. If this is not specified, the latest release tag is installed")
cmd.Flags().IntVar(&c.asset, "asset", -1, "specify a asset number, start from zero, to download")
f := cmd.Flags()
f.StringVar(&c.tag, "tag", "", "specify a tag constraint. If this is not specified, the latest release tag is installed")
f.IntVar(&c.asset, "asset", -1, "specify a asset number, start from zero, to download")

return cmd
}
Expand Down

0 comments on commit 32ea2f6

Please sign in to comment.