-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
59 lines (54 loc) · 1.62 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"log"
"os"
"github.com/kha7iq/ncp/cmd/nfs3/from"
"github.com/kha7iq/ncp/cmd/nfs3/to"
"github.com/kha7iq/ncp/cmd/nfs4/v4from"
"github.com/kha7iq/ncp/cmd/nfs4/v4to"
"github.com/kha7iq/ncp/internal/helper"
"github.com/urfave/cli/v2"
)
// Version variables are used for semVer
var (
version string
commitSHA string
)
// main with all the function into commands
func main() {
app := cli.NewApp()
app.Name = "ncp"
app.Flags = []cli.Flag{
&cli.IntFlag{
Name: "uid",
Aliases: []string{"u"},
Usage: "UID is a globally applicable flag that can be utilized for write operations.",
},
&cli.IntFlag{
Name: "gid",
Aliases: []string{"g"},
Usage: "GID is a globally applicable flag that can be utilized for write operations.",
},
&cli.BoolFlag{
Name: "turncate",
Aliases: []string{"tr"},
Usage: "Enable or disable truncation of long file names in progress bar",
Value: true,
EnvVars: []string{"NCP_FILENAME_TURNICATE"},
},
}
app.Version = version + " CommitSHA: " + helper.TrimSHA(commitSHA)
app.Usage = "provides a straightforward and efficient way to handle file transfers between the local machine and a NFS server."
app.Description = `NCP offers a user-friendly solution for efficiently transferring files and folders between your local machine
and the NFS server. It enables seamless recursive upload and download operations, supporting both NFS v3 and NFS V4 protocols.`
app.Commands = []*cli.Command{
to.ToServerV3(),
from.FromServerV3(),
v4to.ToServerV4(),
v4from.FromServerV4(),
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}