cli args
Node.js
const args = process.argv.slice(2)
console.log(args)
Output
$ node examples/cli_args.js foo bar qux
[ 'foo', 'bar', 'qux' ]
Go
package main
import (
"fmt"
"os"
)
func main() {
args := os.Args[1:]
fmt.Println(args)
}
Output
$ go run examples/cli_args.go foo bar qux
[foo bar qux]
当前内容版权归 miguelmota 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 miguelmota .