aboutsummaryrefslogtreecommitdiff
path: root/.run/src/bin/go-script.go
blob: bdc88ef3828253d551ae57254c971a73399efed5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import (
	"fmt"
	"os"
	"strings"
)

func main() {
	cwd, _ := os.Getwd()
	quoted := make([]string, len(os.Args[1:]))
	for i, a := range os.Args[1:] {
		quoted[i] = fmt.Sprintf("\"%s\"", a)
	}
	args := strings.Join(quoted, ", ")

	fmt.Println()
	fmt.Println("  Welcome to use `run.sh` / `run.ps1`")
	fmt.Println()
	fmt.Println("  > \"Hello World\"")
	fmt.Printf("  > cwd  : \"%s\"\n", cwd)
	fmt.Printf("  > args : %s\n", args)
	fmt.Println()
}