From 20e3b48cb1e8408c83207065dcf20b17778226c9 Mon Sep 17 00:00:00 2001 From: rsteube Date: Mon, 11 Mar 2024 17:01:46 +0100 Subject: [PATCH] updated package path --- README.md | 10 ++-- action.go | 2 +- cmd/carapace-spec/cmd/root.go | 4 +- cmd/carapace-spec/main.go | 2 +- codegen.go | 4 +- command.go | 4 +- command_test.go | 6 +-- core.go | 2 +- docs/book.toml | 4 +- docs/src/carapace-spec.md | 2 +- .../carapace-spec/command/completion/dash.md | 2 +- .../command/completion/dashAny.md | 2 +- .../carapace-spec/command/completion/flag.md | 2 +- .../command/completion/positional.md | 2 +- .../command/completion/positionalAny.md | 2 +- docs/src/carapace-spec/command/flags.md | 2 +- docs/src/carapace-spec/command/group.md | 2 +- docs/src/carapace-spec/command/name.md | 2 +- docs/src/carapace-spec/macros.md | 2 +- docs/src/carapace-spec/macros/core.md | 12 ++--- docs/src/carapace-spec/macros/custom.md | 4 +- docs/src/carapace-spec/macros/modifier.md | 52 +++++++++---------- example_test.go | 2 +- flag.go | 4 +- flag_test.go | 4 +- go.mod | 6 +-- go.sum | 8 +-- internal/pflagfork/flag.go | 2 +- macro.go | 4 +- macro_test.go | 2 +- modifier.go | 4 +- modifier_test.go | 6 +-- register.go | 2 +- run.go | 2 +- spec_test.go | 6 +-- 35 files changed, 89 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 7ac62e8..c3309a2 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ # carapace-spec -[![PkgGoDev](https://pkg.go.dev/badge/github.com/rsteube/carapace-spec/pkg/actions)](https://pkg.go.dev/github.com/rsteube/carapace-spec) -[![GoReportCard](https://goreportcard.com/badge/github.com/rsteube/carapace-spec)](https://goreportcard.com/report/github.com/rsteube/carapace-spec) -[![documentation](https://img.shields.io/badge/‌-documentation-blue?logo=gitbook)](https://rsteube.github.io/carapace-spec/) -[![Coverage Status](https://coveralls.io/repos/github/rsteube/carapace-spec/badge.svg?branch=master)](https://coveralls.io/github/rsteube/carapace-spec?branch=master) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/carapace-sh/carapace-spec/pkg/actions)](https://pkg.go.dev/github.com/carapace-sh/carapace-spec) +[![GoReportCard](https://goreportcard.com/badge/github.com/carapace-sh/carapace-spec)](https://goreportcard.com/report/github.com/carapace-sh/carapace-spec) +[![documentation](https://img.shields.io/badge/‌-documentation-blue?logo=gitbook)](https://carapace-sh.github.io/carapace-spec/) +[![Coverage Status](https://coveralls.io/repos/github/carapace-sh/carapace-spec/badge.svg?branch=master)](https://coveralls.io/github/carapace-sh/carapace-spec?branch=master) [![Packaging status](https://repology.org/badge/tiny-repos/carapace-spec.svg)](https://repology.org/project/carapace-spec/versions) -Define simple completions using a spec file (based on [carapace](https://github.com/rsteube/carapace)). +Define simple completions using a spec file (based on [carapace](https://github.com/carapace-sh/carapace)). The `carapace-spec` binary can be used to complete spec files, but [carapace-bin](https://github.com/rsteube/carapace-bin) is recommended as it supports a range of [custom macros](https://rsteube.github.io/carapace-bin/spec/macros.html). diff --git a/action.go b/action.go index f2d7e6f..551d819 100644 --- a/action.go +++ b/action.go @@ -8,8 +8,8 @@ import ( "sort" "strings" + "github.com/carapace-sh/carapace" "github.com/invopop/jsonschema" - "github.com/rsteube/carapace" "github.com/spf13/cobra" "github.com/spf13/pflag" "gopkg.in/yaml.v3" diff --git a/cmd/carapace-spec/cmd/root.go b/cmd/carapace-spec/cmd/root.go index 2a06dfc..395b744 100644 --- a/cmd/carapace-spec/cmd/root.go +++ b/cmd/carapace-spec/cmd/root.go @@ -9,8 +9,8 @@ import ( "path/filepath" "strings" - "github.com/rsteube/carapace" - spec "github.com/rsteube/carapace-spec" + "github.com/carapace-sh/carapace" + spec "github.com/carapace-sh/carapace-spec" "github.com/spf13/cobra" "gopkg.in/yaml.v3" ) diff --git a/cmd/carapace-spec/main.go b/cmd/carapace-spec/main.go index 6b3d6cf..d46cbed 100644 --- a/cmd/carapace-spec/main.go +++ b/cmd/carapace-spec/main.go @@ -1,6 +1,6 @@ package main -import "github.com/rsteube/carapace-spec/cmd/carapace-spec/cmd" +import "github.com/carapace-sh/carapace-spec/cmd/carapace-spec/cmd" func main() { cmd.Execute() diff --git a/codegen.go b/codegen.go index b140eba..0108df8 100644 --- a/codegen.go +++ b/codegen.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/rsteube/carapace-spec/internal/pflagfork" + "github.com/carapace-sh/carapace-spec/internal/pflagfork" "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -22,7 +22,7 @@ type codegenCmd struct { func (s codegenCmd) formatHeader() string { return `package cmd import ( - "github.com/rsteube/carapace" + "github.com/carapace-sh/carapace" "github.com/spf13/cobra" ) ` diff --git a/command.go b/command.go index 734b8c2..63359de 100644 --- a/command.go +++ b/command.go @@ -5,8 +5,8 @@ import ( "path/filepath" "regexp" - "github.com/rsteube/carapace" - "github.com/rsteube/carapace-spec/pkg/command" + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-spec/pkg/command" "github.com/spf13/cobra" "gopkg.in/yaml.v3" ) diff --git a/command_test.go b/command_test.go index efcbfe4..9877d88 100644 --- a/command_test.go +++ b/command_test.go @@ -4,9 +4,9 @@ import ( _ "embed" "testing" - "github.com/rsteube/carapace" - "github.com/rsteube/carapace/pkg/sandbox" - "github.com/rsteube/carapace/pkg/style" + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace/pkg/sandbox" + "github.com/carapace-sh/carapace/pkg/style" ) //go:embed example/command.yaml diff --git a/core.go b/core.go index 95dc459..1f69e7b 100644 --- a/core.go +++ b/core.go @@ -4,7 +4,7 @@ import ( "runtime" "strings" - "github.com/rsteube/carapace" + "github.com/carapace-sh/carapace" ) func init() { diff --git a/docs/book.toml b/docs/book.toml index 630107d..624752e 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -9,8 +9,8 @@ title = "carapace-spec" default-theme = "Mocha" additional-css = ["asciinema/asciinema-player.css", "./theme/catppuccin.css"] additional-js = ["asciinema/asciinema-player.min.js", "asciinema/load.js"] -git-repository-url = "https://github.com/rsteube/carapace-spec" -edit-url-template = "https://github.com/rsteube/carapace-spec/edit/master/docs/{path}" +git-repository-url = "https://github.com/carapace-sh/carapace-spec" +edit-url-template = "https://github.com/carapace-sh/carapace-spec/edit/master/docs/{path}" [output.html.fold] enable = true diff --git a/docs/src/carapace-spec.md b/docs/src/carapace-spec.md index 06f4107..f91be76 100644 --- a/docs/src/carapace-spec.md +++ b/docs/src/carapace-spec.md @@ -1,6 +1,6 @@ # carapace-spec -Define simple completions using a spec file (based on [carapace](https://github.com/rsteube/carapace)). +Define simple completions using a spec file (based on [carapace](https://github.com/carapace-sh/carapace)). ```yaml name: mycmd diff --git a/docs/src/carapace-spec/command/completion/dash.md b/docs/src/carapace-spec/command/completion/dash.md index 8ca9d6e..ef81c2a 100644 --- a/docs/src/carapace-spec/command/completion/dash.md +++ b/docs/src/carapace-spec/command/completion/dash.md @@ -1,6 +1,6 @@ # Dash -Define [dash completion](https://rsteube.github.io/carapace/carapace/gen/dashCompletion.html). +Define [dash completion](https://carapace-sh.github.io/carapace/carapace/gen/dashCompletion.html). ```yaml # yaml-language-server: $schema=https://carapace.sh/schemas/command.json diff --git a/docs/src/carapace-spec/command/completion/dashAny.md b/docs/src/carapace-spec/command/completion/dashAny.md index 001149e..e938606 100644 --- a/docs/src/carapace-spec/command/completion/dashAny.md +++ b/docs/src/carapace-spec/command/completion/dashAny.md @@ -1,6 +1,6 @@ # DashAny -Define [dash any completion](https://rsteube.github.io/carapace/carapace/gen/dashAnyCompletion.html). +Define [dash any completion](https://carapace-sh.github.io/carapace/carapace/gen/dashAnyCompletion.html). ```yaml # yaml-language-server: $schema=https://carapace.sh/schemas/command.json diff --git a/docs/src/carapace-spec/command/completion/flag.md b/docs/src/carapace-spec/command/completion/flag.md index c49e7cb..f39776e 100644 --- a/docs/src/carapace-spec/command/completion/flag.md +++ b/docs/src/carapace-spec/command/completion/flag.md @@ -1,6 +1,6 @@ # Flag -Define [flag completion](https://rsteube.github.io/carapace/carapace/gen/flagCompletion.html). +Define [flag completion](https://carapace-sh.github.io/carapace/carapace/gen/flagCompletion.html). ```yaml # yaml-language-server: $schema=https://carapace.sh/schemas/command.json diff --git a/docs/src/carapace-spec/command/completion/positional.md b/docs/src/carapace-spec/command/completion/positional.md index 53f987b..bff0803 100644 --- a/docs/src/carapace-spec/command/completion/positional.md +++ b/docs/src/carapace-spec/command/completion/positional.md @@ -1,6 +1,6 @@ # Positional -Define [positional completion](https://rsteube.github.io/carapace/carapace/gen/positionalCompletion.html). +Define [positional completion](https://carapace-sh.github.io/carapace/carapace/gen/positionalCompletion.html). ```yaml # yaml-language-server: $schema=https://carapace.sh/schemas/command.json diff --git a/docs/src/carapace-spec/command/completion/positionalAny.md b/docs/src/carapace-spec/command/completion/positionalAny.md index fe422a9..a5e52da 100644 --- a/docs/src/carapace-spec/command/completion/positionalAny.md +++ b/docs/src/carapace-spec/command/completion/positionalAny.md @@ -1,6 +1,6 @@ # PositionalAny -Define [positional any completion](https://rsteube.github.io/carapace/carapace/gen/positionalCompletion.html). +Define [positional any completion](https://carapace-sh.github.io/carapace/carapace/gen/positionalCompletion.html). ```yaml # yaml-language-server: $schema=https://carapace.sh/schemas/command.json diff --git a/docs/src/carapace-spec/command/flags.md b/docs/src/carapace-spec/command/flags.md index 07c8db1..48f74dd 100644 --- a/docs/src/carapace-spec/command/flags.md +++ b/docs/src/carapace-spec/command/flags.md @@ -21,7 +21,7 @@ flags: ## Non-posix -With [carapace-pflag](https://github.com/rsteube/carapace-pflag) non-posix flags possible as well: +With [carapace-pflag](https://github.com/carapace-sh/carapace-pflag) non-posix flags possible as well: ```yaml -np: non-posix shorthand diff --git a/docs/src/carapace-spec/command/group.md b/docs/src/carapace-spec/command/group.md index 8d5b01a..694116f 100644 --- a/docs/src/carapace-spec/command/group.md +++ b/docs/src/carapace-spec/command/group.md @@ -6,4 +6,4 @@ group: core ``` -[Group]:https://rsteube.github.io/carapace/carapace/command/group.html \ No newline at end of file +[Group]:https://carapace-sh.github.io/carapace/carapace/command/group.html \ No newline at end of file diff --git a/docs/src/carapace-spec/command/name.md b/docs/src/carapace-spec/command/name.md index 5644d00..f9dd989 100644 --- a/docs/src/carapace-spec/command/name.md +++ b/docs/src/carapace-spec/command/name.md @@ -6,7 +6,7 @@ Name of the command. name: add ``` -It can also contain the one-line [usage](https://rsteube.github.io/carapace/carapace/action/usage.html) message. +It can also contain the one-line [usage](https://carapace-sh.github.io/carapace/carapace/action/usage.html) message. ```yaml name: add [-F file | -D dir]... [-f format] profile diff --git a/docs/src/carapace-spec/macros.md b/docs/src/carapace-spec/macros.md index 13e2265..a19f794 100644 --- a/docs/src/carapace-spec/macros.md +++ b/docs/src/carapace-spec/macros.md @@ -1,5 +1,5 @@ # Macros -Macros are basically [Actions](https://rsteube.github.io/carapace/carapace/action.html) exposed to the spec (E.g. [`$files([.go, go.mod])`](https://rsteube.github.io/carapace/carapace/action/actionFiles.html). +Macros are basically [Actions](https://carapace-sh.github.io/carapace/carapace/action.html) exposed to the spec (E.g. [`$files([.go, go.mod])`](https://carapace-sh.github.io/carapace/carapace/action/actionFiles.html). > The brackets are optional if no argument is passed (so `$files` is equivalent to `$files()`). diff --git a/docs/src/carapace-spec/macros/core.md b/docs/src/carapace-spec/macros/core.md index 68c4d24..8958d83 100644 --- a/docs/src/carapace-spec/macros/core.md +++ b/docs/src/carapace-spec/macros/core.md @@ -1,17 +1,17 @@ # Core -Core macros provided by [carapace-spec](https://github.com/rsteube/carapace-spec). +Core macros provided by [carapace-spec](https://github.com/carapace-sh/carapace-spec). ## directories -[`$directories`](https://rsteube.github.io/carapace/carapace/defaultActions/actionDirectories.html) completes directories. +[`$directories`](https://carapace-sh.githbub.io/carapace/carapace/defaultActions/actionDirectories.html) completes directories. ```yaml ["$directories"] ``` ## exec -[`$()`](https://rsteube.github.io/carapace/carapace/defaultActions/actionExecCommand.html) executes given command in a `sh` / `pwsh` shell. +[`$()`](https://carapace-sh.githbub.io/carapace/carapace/defaultActions/actionExecCommand.html) executes given command in a `sh` / `pwsh` shell. ```yaml ["$(echo -e 'a\nb\nc')"] @@ -19,7 +19,7 @@ Core macros provided by [carapace-spec](https://github.com/rsteube/carapace-spec ## executables -[`$executables`](https://rsteube.github.io/carapace/carapace/defaultActions/actionExecutables.html) completes [PATH] executables. +[`$executables`](https://carapace-sh.githbub.io/carapace/carapace/defaultActions/actionExecutables.html) completes [PATH] executables. ```yaml ["$executables"] @@ -27,7 +27,7 @@ Core macros provided by [carapace-spec](https://github.com/rsteube/carapace-spec ## files -[`$files([])`](https://rsteube.github.io/carapace/carapace/defaultActions/actionFiles.html) completes files with an optional list of suffixes to filter on. +[`$files([])`](https://carapace-sh.githbub.io/carapace/carapace/defaultActions/actionFiles.html) completes files with an optional list of suffixes to filter on. ```yaml ["$files([.go, go.mod, go.sum])"] @@ -35,7 +35,7 @@ Core macros provided by [carapace-spec](https://github.com/rsteube/carapace-spec ## message -[`$message()`](https://rsteube.github.io/carapace/carapace/defaultActions/actionMessage.html) adds given error message to completion. +[`$message()`](https://carapace-sh.githbub.io/carapace/carapace/defaultActions/actionMessage.html) adds given error message to completion. ```yaml ["$message(some error)"] diff --git a/docs/src/carapace-spec/macros/custom.md b/docs/src/carapace-spec/macros/custom.md index 8fdb280..fc3c344 100644 --- a/docs/src/carapace-spec/macros/custom.md +++ b/docs/src/carapace-spec/macros/custom.md @@ -1,6 +1,6 @@ # Custom -Custom macros can be added with [`AddMacro`](https://pkg.go.dev/github.com/rsteube/carapace-spec#AddMacro). +Custom macros can be added with [`AddMacro`](https://pkg.go.dev/github.com/carapace-sh/carapace-spec#AddMacro). ```go // `$_noarg` without argument @@ -17,7 +17,7 @@ AddMacro("vararg", MacroV(func(s ...string) carapace.Action { return carapace.Ac ## Default (experimental) -A `Default()` method can be added to a struct passed to [`MacroI`](https://pkg.go.dev/github.com/rsteube/carapace-spec#MacroI). +A `Default()` method can be added to a struct passed to [`MacroI`](https://pkg.go.dev/github.com/carapace-sh/carapace-spec#MacroI). It will be called when the macro is used without argumeng (`$_arg` instead of `$_arg({user: example})`). diff --git a/docs/src/carapace-spec/macros/modifier.md b/docs/src/carapace-spec/macros/modifier.md index bd3f73c..b55434b 100644 --- a/docs/src/carapace-spec/macros/modifier.md +++ b/docs/src/carapace-spec/macros/modifier.md @@ -9,7 +9,7 @@ These can be set ## chdir -[`$chdir()`](https://rsteube.github.io/carapace/carapace/action/chdir.html) changes the directory. +[`$chdir()`](https://carapace-sh.github.io/carapace/carapace/action/chdir.html) changes the directory. ```yaml ["$files", "$chdir(/tmp)"] @@ -33,7 +33,7 @@ The following macros can be passed as well instead of a static directory: ## filter -[`$filter([])`](https://rsteube.github.io/carapace/carapace/action/filter.html) filters given values. +[`$filter([])`](https://carapace-sh.github.io/carapace/carapace/action/filter.html) filters given values. ```yaml ["one", "two", "three", "$filter([two])"] @@ -41,7 +41,7 @@ The following macros can be passed as well instead of a static directory: ## filterargs -[`$filterargs`](https://rsteube.github.io/carapace/carapace/action/filterArgs.html) filters `Context.Args`. +[`$filterargs`](https://carapace-sh.github.io/carapace/carapace/action/filterArgs.html) filters `Context.Args`. ```yaml ["$files", "$filterargs"] @@ -49,7 +49,7 @@ The following macros can be passed as well instead of a static directory: ## list -[`$list()`](https://rsteube.github.io/carapace/carapace/action/list.html) creates a list with given divider. +[`$list()`](https://carapace-sh.github.io/carapace/carapace/action/list.html) creates a list with given divider. ```yaml ["one", "two", "three", "$list(,)"] @@ -57,7 +57,7 @@ The following macros can be passed as well instead of a static directory: ## multiparts -[`$multiparts([])`](https://rsteube.github.io/carapace/carapace/action/multiParts.html) completes values splitted by given delimiter(s) separately. +[`$multiparts([])`](https://carapace-sh.github.io/carapace/carapace/action/multiParts.html) completes values splitted by given delimiter(s) separately. ```yaml ["one/two/three", "$multiparts([/])"] @@ -65,7 +65,7 @@ The following macros can be passed as well instead of a static directory: ## nospace -[`$nospace()`](https://rsteube.github.io/carapace/carapace/action/noSpace.html) disables space suffix for given character(s). +[`$nospace()`](https://carapace-sh.github.io/carapace/carapace/action/noSpace.html) disables space suffix for given character(s). ```yaml ["one", "two/", "three,", "$nospace(/,)"] @@ -73,7 +73,7 @@ The following macros can be passed as well instead of a static directory: ## prefix -[`$pefix()`](https://rsteube.github.io/carapace/carapace/action/prefix.html) adds a prefix to the inserted values. +[`$pefix()`](https://carapace-sh.github.io/carapace/carapace/action/prefix.html) adds a prefix to the inserted values. ```yaml ["$files", "$prefix(file://)"] @@ -81,7 +81,7 @@ The following macros can be passed as well instead of a static directory: ## retain -[`$retain([])`](https://rsteube.github.io/carapace/carapace/action/retain.html) retains given values. +[`$retain([])`](https://carapace-sh.github.io/carapace/carapace/action/retain.html) retains given values. ```yaml ["one", "two", "three", "$retain([two])"] @@ -89,7 +89,7 @@ The following macros can be passed as well instead of a static directory: ## shift -[`$shift()`](https://rsteube.github.io/carapace/carapace/action/shift.html) shifts positional arguments left n times. +[`$shift()`](https://carapace-sh.github.io/carapace/carapace/action/shift.html) shifts positional arguments left n times. ```yaml ["one", "two", "three", "$filterargs", "$shift(1)"] @@ -97,7 +97,7 @@ The following macros can be passed as well instead of a static directory: ## split -[`$split`](https://rsteube.github.io/carapace/carapace/action/split.html) splits `Context.Value` lexicographically and replaces `Context.Args` with the tokens. +[`$split`](https://carapace-sh.github.io/carapace/carapace/action/split.html) splits `Context.Value` lexicographically and replaces `Context.Args` with the tokens. ```yaml ["one", "two", "three", "$filterargs", "$split"] @@ -105,7 +105,7 @@ The following macros can be passed as well instead of a static directory: ## splitp -[`$splitp`](https://rsteube.github.io/carapace/carapace/action/splitP.html) is like Split but supports pipelines. +[`$splitp`](https://carapace-sh.github.io/carapace/carapace/action/splitP.html) is like Split but supports pipelines. ```yaml ["one", "two", "three", "$filterargs", "$splitp"] @@ -113,7 +113,7 @@ The following macros can be passed as well instead of a static directory: ## suffix -[`$suffix()`](https://rsteube.github.io/carapace/carapace/action/suffix.html) adds a suffix to the inserted values. +[`$suffix()`](https://carapace-sh.github.io/carapace/carapace/action/suffix.html) adds a suffix to the inserted values. ```yaml ["apple", "melon", "orange", "$suffix(juice)"] @@ -121,14 +121,14 @@ The following macros can be passed as well instead of a static directory: ## suppress -[`$suppress()`](https://rsteube.github.io/carapace/carapace/action/suppress.html) suppresses specific error messages using a regular expression. +[`$suppress()`](https://carapace-sh.github.io/carapace/carapace/action/suppress.html) suppresses specific error messages using a regular expression. ```yaml ["$message(fail)", "$suppress(fail)"] ``` ## style -[`$style(