Skip to content

Commit

Permalink
make file added
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshpith committed Jul 6, 2021
1 parent 2ad328f commit 9f7f781
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
run:
go run main.go

build:
go build

cli-c:
echo "Compiling for every OS and Platform"; \
GOOS=freebsd GOARCH=386 go build -o bin/pith-freebsd-386 main.go;\
GOOS=linux GOARCH=386 go build -o bin/pith-linux-386 main.go; \
GOOS=windows GOARCH=386 go build -o bin/pith-windows-386 main.go
Binary file added ashutoshpith
Binary file not shown.
11 changes: 10 additions & 1 deletion base/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ func TextFlag() *cli.StringFlag {
return &f

}

func ArgFlag() *cli.StringFlag {
f := cli.StringFlag {
Name: "arg",
Aliases: []string{"a"},
Usage: "Args",
}
return &f

}

func HostFlag() *cli.StringFlag {
f := cli.StringFlag {
Name: "host",
Expand Down
Binary file added bin/pith-freebsd-386
Binary file not shown.
Binary file added bin/pith-linux-386
Binary file not shown.
Binary file added bin/pith-windows-386
Binary file not shown.
3 changes: 2 additions & 1 deletion download/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ func Url(flags []cli.Flag) *cli.Command {
Action: func (c *cli.Context) error {
fmt.Println("Url Downloader started")
text := c.String("text")
arg := c.String("arg")
filepath, _ := os.Getwd()
fmt.Println("cw ", filepath)
setPath := filepath + "/dir/" + "logo.svg"
fmt.Println("set ", setPath)
err := UrlDownloadFile("lo.svg", text)
err := UrlDownloadFile(arg, text)
if err != nil {
panic(err)
}
Expand Down
1 change: 1 addition & 0 deletions lok.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Main.go → main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ func main() {

textFlag := base.TextFlag()
hostFlag := base.HostFlag()
argFlag := base.ArgFlag()

app.Flags = []cli.Flag {
textFlag, hostFlag,
textFlag, hostFlag, argFlag,
}

testCommand := base.Test(app.Flags)
Expand Down

0 comments on commit 9f7f781

Please sign in to comment.