This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,13 +108,8 @@ var (
108108 },
109109 {
110110 Name : "unload" ,
111- Usage : "unload <plugin_type>:<plugin_name>:<plugin_version> or unload -t <plugin_type> -n < plugin_name> -v <plugin_version>" ,
111+ Usage : "unload <plugin_type> < plugin_name> <plugin_version>" ,
112112 Action : unloadPlugin ,
113- Flags : []cli.Flag {
114- flPluginType ,
115- flPluginName ,
116- flPluginVersion ,
117- },
118113 },
119114 {
120115 Name : "swap" ,
Original file line number Diff line number Diff line change @@ -64,29 +64,19 @@ func loadPlugin(ctx *cli.Context) error {
6464}
6565
6666func unloadPlugin (ctx * cli.Context ) error {
67- pDetails := filepath .SplitList (ctx .Args ().First ())
68- var pType , pName string
69- var pVer int
70- var err error
67+ pType := ctx .Args ().Get (0 )
68+ pName := ctx .Args ().Get (1 )
69+ pVer , err := strconv .Atoi (ctx .Args ().Get (2 ))
7170
72- if len (pDetails ) == 3 {
73- pType = pDetails [0 ]
74- pName = pDetails [1 ]
75- pVer , err = strconv .Atoi (pDetails [2 ])
76- if err != nil {
77- return newUsageError ("Can't convert version string to integer" , ctx )
78- }
79- } else {
80- pType = ctx .String ("plugin-type" )
81- pName = ctx .String ("plugin-name" )
82- pVer = ctx .Int ("plugin-version" )
83- }
8471 if pType == "" {
8572 return newUsageError ("Must provide plugin type" , ctx )
8673 }
8774 if pName == "" {
8875 return newUsageError ("Must provide plugin name" , ctx )
8976 }
77+ if err != nil {
78+ return newUsageError ("Can't convert version string to integer" , ctx )
79+ }
9080 if pVer < 1 {
9181 return newUsageError ("Must provide plugin version" , ctx )
9282 }
You can’t perform that action at this time.
0 commit comments