@@ -3,8 +3,6 @@ package lib
33import (
44 "fmt"
55 "os"
6- "strings"
7- "time"
86
97 "github.com/aliyun/alibaba-cloud-sdk-go/sdk"
108 "github.com/aliyun/aliyun-cli/cli"
@@ -124,11 +122,6 @@ func ParseAndRunCommandFromCli(ctx *cli.Context, args []string) error {
124122 // configs[OptionLanguage] = "EN"
125123 //}
126124
127- ts := time .Now ().UnixNano ()
128- commandLine = strings .Join (os .Args [1 :], " " )
129- // os.Args = []string {"aliyun", "oss", "ls"}
130-
131- clearEnv ()
132125 a2 := []string {"aliyun" , "oss" }
133126 a2 = append (a2 , ctx .Command ().Name )
134127 for _ , a := range args {
@@ -155,28 +148,9 @@ func ParseAndRunCommandFromCli(ctx *cli.Context, args []string) error {
155148 a2 = append (a2 , v )
156149 }
157150 }
151+ os .Args = a2 [1 :]
152+ return ParseAndRunCommand ()
158153
159- os .Args = a2
160- // cli.Noticef("%v", os.Args)
161-
162- args , options , err := ParseArgOptions ()
163- if err != nil {
164- return err
165- }
166-
167- args = args [1 :]
168- // fmt.Printf("%v", args)
169- showElapse , err := RunCommand (args , options )
170- if err != nil {
171- return err
172- }
173-
174- if showElapse {
175- te := time .Now ().UnixNano ()
176- fmt .Printf ("%.6f(s) elapsed\n " , float64 (te - ts )/ 1e9 )
177- return nil
178- }
179- return nil
180154}
181155
182156func getSessionCredential (profile * config.Profile ) (string , string , string , error ) {
0 commit comments