MCPcopy Index your code
hub / github.com/bitfield/script / ExamplePipe_Basename

Function ExamplePipe_Basename

script_windows_test.go:53–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51}
52
53func ExamplePipe_Basename() {
54 input := []string{
55 "",
56 "/",
57 "/root",
58 "/tmp/example.php",
59 "/var/tmp/",
60 "./src/filters",
61 "C:\\Program Files",
62 }
63 script.Slice(input).Basename().Stdout()
64 // Output:
65 // .
66 // \
67 // root
68 // example.php
69 // tmp
70 // filters
71 // Program Files
72}
73
74func ExamplePipe_Dirname() {
75 input := []string{

Callers

nothing calls this directly

Calls 3

SliceFunction · 0.92
StdoutMethod · 0.80
BasenameMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…