diff options
| author | ewy <ewy0@protonmail.com> | 2026-06-06 16:55:11 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-06-06 16:55:11 +0200 |
| commit | 8a376262447f8858d83d07e0d98e8e4ea5c50865 (patch) | |
| tree | 1b950a49f56aea32842e2a6fc5dc243e27f051b2 /man | |
| parent | 58e255d3c16c7d4a7d08afde7dd3acf481e2d8ae (diff) | |
add more shit to the manpage
Diffstat (limited to 'man')
| -rw-r--r-- | man/manview/data.go | 6 | ||||
| -rw-r--r-- | man/manview/manview.go | 3 | ||||
| -rw-r--r-- | man/manview/templates/pik.1.man.tmpl | 31 |
3 files changed, 36 insertions, 4 deletions
diff --git a/man/manview/data.go b/man/manview/data.go index 8c21ffd..b59c78f 100644 --- a/man/manview/data.go +++ b/man/manview/data.go @@ -3,6 +3,8 @@ package manview import ( _ "embed" _ "git.sr.ht/~ewy/pik/flags" + "git.sr.ht/~ewy/pik/indexers/pikdex" + "git.sr.ht/~ewy/pik/model" "git.sr.ht/~ewy/pik/spool" "github.com/spf13/pflag" "runtime" @@ -20,6 +22,8 @@ type ManData struct { Runtime string Version string ExitCodes map[int]*spool.ExitCode + MetaFiles map[string]*pikdex.MetaFile + TagMap map[string]*model.Tag } func NewData() ManData { @@ -39,5 +43,7 @@ func NewData() ManData { Version: version, Revision: info.Main.Version, ExitCodes: spool.CodeMap, + MetaFiles: pikdex.MetaFiles, + TagMap: model.TagMap, } } diff --git a/man/manview/manview.go b/man/manview/manview.go index 8dd7edd..6d8bfc3 100644 --- a/man/manview/manview.go +++ b/man/manview/manview.go @@ -22,7 +22,8 @@ func View(fallback string) error { return err } else { t := &strings.Builder{} - err := page.Execute(t, NewData()) + d := NewData() + err := page.Execute(t, d) if err != nil { return err } diff --git a/man/manview/templates/pik.1.man.tmpl b/man/manview/templates/pik.1.man.tmpl index 53f1cfd..e4361b0 100644 --- a/man/manview/templates/pik.1.man.tmpl +++ b/man/manview/templates/pik.1.man.tmpl @@ -1,4 +1,4 @@ -{{- /*gotype: github.com/ewy1/pik/man.ManData*/ -}} +{{- /*gotype: git.sr.ht/~ewy/pik/man/manview.ManData*/ -}} .TH PIK 1 {{.Version}} {{.Runtime}} .sh NAME pik \- file based task runner @@ -9,21 +9,46 @@ pik \- file based task runner .B pik executes scripts from the .pik folder or external runners. .SH EXAMPLES +.PP +Invoke +.B pik +without arguments to open the tui. +.PP Given a .pik folder in your current working directory containing "script.sh", calling .B pik script will start that script. .PP To start a script from another location, pass that as the SOURCE before the TARGET. Example: .B pik project build -will start ../../.pik/build.py if it exists. +from \fI/project/src/dir\fR (and similar paths) +will start \fI/project/.pik/build.py\fR if it exists. .SH OPTIONS {{ range .Flags -}} .TP .BR \-\-{{.Name }} {{ if .Shorthand }}, \-{{ .Shorthand }}{{ end }} = {{ .Value.Type }} {{ if .DefValue }} ({{.DefValue}}) {{- end }} {{ .Usage }} {{ end }} +.SH TARGET CONFIGURATION +Targets can be configured with tags. Tags are put in filenames, and should have a \. before and after the tag. +.PP +.B EXAMPLE: +test.here.single.sh has the 'here' and 'single' tag. +{{ range $t, $v := .TagMap }} +.TP +.BR {{ $t}} +{{ $v.Description }} +{{ end }} +.SH SOURCE CONFIGURATION +Most source configuration files can contain multiple lines, including blank lines. "#" and "//" will be interpreted as comments. +{{ range $f, $v := .MetaFiles -}} +{{- if $v.Description }} +.TP +.BR .pik/{{$f}} +{{ $v.Description }} +{{- end -}} +{{- end}} .SH EXIT CODES -If the target runs and returns a non-zero error code, we pass that forward instead. +If the target runs and returns a non-zero error code, we pass that back to the user instead. {{ range .ExitCodes -}} .TP .BR {{ .Value }} |
