Skip to content

Commit 4e2a7d6

Browse files
committed
Add interface of command line
1 parent 809e7b1 commit 4e2a7d6

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

bin/hexlet-path-size

2.66 MB
Binary file not shown.

cmd/hexlet-path-size/main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
package main
22

33
import (
4+
"context"
45
"fmt"
6+
"log"
7+
"os"
8+
9+
"github.com/urfave/cli/v3"
510
)
611

712
func main() {
813
fmt.Println("Hello from Hexlet!")
14+
cmd := &cli.Command{
15+
Name: "hexlet-path-size",
16+
Usage: "print size of a file or directory;",
17+
}
18+
19+
if err := cmd.Run(context.Background(), os.Args); err != nil {
20+
log.Fatal(err)
21+
}
22+
923
}

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module code
22

33
go 1.24.4
4+
5+
require github.com/urfave/cli/v3 v3.3.8 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/urfave/cli/v3 v3.3.8 h1:BzolUExliMdet9NlJ/u4m5vHSotJ3PzEqSAZ1oPMa/E=
2+
github.com/urfave/cli/v3 v3.3.8/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=

path_size.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
11
package main
2+
3+
import (
4+
"context"
5+
"log"
6+
"os"
7+
8+
"github.com/urfave/cli/v3"
9+
)
10+
11+
func Help() {
12+
cmd := &cli.Command{
13+
Name: "hexlet-path-size",
14+
Usage: "print size of a file or directory;",
15+
}
16+
17+
if err := cmd.Run(context.Background(), os.Args); err != nil {
18+
log.Fatal(err)
19+
}
20+
}

0 commit comments

Comments
 (0)