Add README and upload function stub
This commit is contained in:
@@ -30,6 +30,20 @@ func New(cc *context.Context) {
|
||||
DefaultValue: 0000000,
|
||||
})
|
||||
|
||||
_ = c.Flagger.AddFlag(&flagger.Flag{
|
||||
Name: "uploadPath",
|
||||
Description: "Path to upload your file on Yandex.Disk. Must exist before uploading.",
|
||||
Type: "string",
|
||||
DefaultValue: "/",
|
||||
})
|
||||
|
||||
_ = c.Flagger.AddFlag(&flagger.Flag{
|
||||
Name: "file",
|
||||
Description: "Path to file that will be uploaded. Max upload size - 50 GB",
|
||||
Type: "string",
|
||||
DefaultValue: "",
|
||||
})
|
||||
|
||||
dlog.Info().Msg("Domain initialized")
|
||||
}
|
||||
|
||||
@@ -40,7 +54,14 @@ func Process() {
|
||||
sendCode(authCode)
|
||||
}
|
||||
|
||||
filePath, _ := c.Flagger.GetStringValue("file")
|
||||
if filePath != "" {
|
||||
uploadFile()
|
||||
}
|
||||
|
||||
if !checkAuth() {
|
||||
authorize()
|
||||
}
|
||||
|
||||
showHelp()
|
||||
}
|
||||
|
15
domains/yandex/v1/help.go
Normal file
15
domains/yandex/v1/help.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// Yandex Disk File Pusher
|
||||
// Copyright (c) 2019 Vladimir "fat0troll" Hodakov
|
||||
|
||||
package yandexv1
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func showHelp() {
|
||||
dlog.Info().Msg("This app is authorized for uploading your files one by one to Yandex.Disk.")
|
||||
dlog.Info().Msg("For information how to use this app, run yapusher with -h flag or head to https://github.com/fat0troll/yapusher/blob/master/README.")
|
||||
|
||||
os.Exit(0)
|
||||
}
|
@@ -57,3 +57,5 @@ func sendCode(code int) {
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func uploadFile() {}
|
||||
|
Reference in New Issue
Block a user