Skip to content

Commit

Permalink
Update the package name
Browse files Browse the repository at this point in the history
  • Loading branch information
Verseth committed Jul 1, 2023
1 parent eb43008 commit ce04c63
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 64 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MIT License

Copyright (c) 2023 Mateusz Drewniak
Copyright (c) 2017 Masashi SHIBATA

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
55 changes: 19 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# go-prompt

[![Go Report Card](https://goreportcard.com/badge/github.com/c-bata/go-prompt)](https://goreportcard.com/report/github.com/c-bata/go-prompt)
[![Go Report Card](https://goreportcard.com/badge/github.com/elk-language/go-prompt)](https://goreportcard.com/report/github.com/elk-language/go-prompt)
![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)
[![GoDoc](https://godoc.org/github.com/c-bata/go-prompt?status.svg)](https://godoc.org/github.com/c-bata/go-prompt)
![tests](https://github.com/c-bata/go-prompt/workflows/tests/badge.svg)
[![GoDoc](https://godoc.org/github.com/elk-language/go-prompt?status.svg)](https://godoc.org/github.com/elk-language/go-prompt)
![tests](https://github.com/elk-language/go-prompt/workflows/tests/badge.svg)

This is a fork of [c-bata/go-prompt](https://github.com/c-bata/go-prompt).
It's a great library but it's been abandoned
for quite a while.
This project aims to continue its development.

---

A library for building powerful interactive prompts inspired by [python-prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit),
making it easier to build cross-platform command line tools using Go.
Expand All @@ -13,7 +20,7 @@ package main

import (
"fmt"
"github.com/c-bata/go-prompt"
"github.com/elk-language/go-prompt"
)

func completer(d prompt.Document) []prompt.Suggest {
Expand All @@ -32,29 +39,6 @@ func main() {
}
```

#### Projects using go-prompt

* [c-bata/kube-prompt : An interactive kubernetes client featuring auto-complete written in Go.](https://github.com/c-bata/kube-prompt)
* [rancher/cli : The Rancher Command Line Interface (CLI)is a unified tool to manage your Rancher server](https://github.com/rancher/cli)
* [kubicorn/kubicorn : Simple, cloud native infrastructure for Kubernetes.](https://github.com/kubicorn/kubicorn)
* [cch123/asm-cli : Interactive shell of assembly language(X86/X64) based on unicorn and rasm2](https://github.com/cch123/asm-cli)
* [ktr0731/evans : more expressive universal gRPC client](https://github.com/ktr0731/evans)
* [CrushedPixel/moshpit: A Command-line tool for datamoshing.](https://github.com/CrushedPixel/moshpit)
* [last-ent/testy-go: Testy Go: A tool for easy testing!](https://github.com/last-ent/testy-go)
* [tiagorlampert/CHAOS: a PoC that allow generate payloads and control remote operating systems.](https://github.com/tiagorlampert/CHAOS)
* [abs-lang/abs: ABS is a scripting language that works best on terminal. It tries to combine the elegance of languages such as Python, or Ruby, to the convenience of Bash.](https://github.com/abs-lang/abs)
* [takashabe/btcli: btcli is a CLI client for the Bigtable. Has many read options and auto-completion.](https://github.com/takashabe/btcli)
* [ysn2233/kafka-prompt: An interactive kafka-prompt(kafka-shell) built on existing kafka command client](https://github.com/ysn2233/kafka-prompt)
* [fishi0x01/vsh: HashiCorp Vault interactive shell](https://github.com/fishi0x01/vsh)
* [mstrYoda/docker-shell: A simple interactive prompt for docker](https://github.com/mstrYoda/docker-shell)
* [c-bata/gh-prompt: An interactive GitHub CLI featuring auto-complete.](https://github.com/c-bata/gh-prompt)
* [docker-slim/docker-slim: Don't change anything in your Docker container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)](https://github.com/docker-slim/docker-slim)
* [rueyaa332266/ezcron: Ezcron is a CLI tool, helping you deal with cron expression easier.](https://github.com/rueyaa332266/ezcron)
* [qingstor/qsctl: Advanced command line tool for QingStor Object Storage.](https://github.com/qingstor/qsctl)
* [segmentio/topicctl: Tool for declarative management of Kafka topics](https://github.com/segmentio/topicctl)
* [chriswalz/bit: Bit is a modern Git CLI](https://github.com/chriswalz/bit)
* (If you create a CLI utility using go-prompt and want your own project to be listed here, please submit a GitHub issue.)

## Features

### Powerful auto-completion
Expand All @@ -65,7 +49,7 @@ func main() {

### Flexible options

go-prompt provides many options. Please check [option section of GoDoc](https://godoc.org/github.com/c-bata/go-prompt#Option) for more details.
go-prompt provides many options. Please check [option section of GoDoc](https://godoc.org/github.com/elk-language/go-prompt#Option) for more details.

[![options](https://github.com/c-bata/assets/raw/master/go-prompt/prompt-options.png)](#flexible-options)

Expand Down Expand Up @@ -109,17 +93,16 @@ We have confirmed go-prompt works fine in the following terminals:
## Links

* [Change Log](./CHANGELOG.md)
* [GoDoc](http://godoc.org/github.com/c-bata/go-prompt)
* [gocover.io](https://gocover.io/github.com/c-bata/go-prompt)
* [GoDoc](http://godoc.org/github.com/elk-language/go-prompt)
* [gocover.io](https://gocover.io/github.com/elk-language/go-prompt)

## License

This software is licensed under the MIT license, see [LICENSE](./LICENSE) for more information.

## Author
## Original Author

Masashi Shibata

* Twitter: [@c\_bata\_](https://twitter.com/c_bata_/)
* Github: [@c-bata](https://github.com/c-bata/)

## License

This software is licensed under the MIT license, see [LICENSE](./LICENSE) for more information.

3 changes: 2 additions & 1 deletion _example/even-lexer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package main

import (
"fmt"
"github.com/c-bata/go-prompt"
"strings"

"github.com/elk-language/go-prompt"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _example/exec-command/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"os/exec"

prompt "github.com/c-bata/go-prompt"
prompt "github.com/elk-language/go-prompt"
)

func executor(t string) {
Expand Down
2 changes: 1 addition & 1 deletion _example/http-prompt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path"
"strings"

prompt "github.com/c-bata/go-prompt"
prompt "github.com/elk-language/go-prompt"
)

type RequestContext struct {
Expand Down
2 changes: 1 addition & 1 deletion _example/live-prefix/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

prompt "github.com/c-bata/go-prompt"
prompt "github.com/elk-language/go-prompt"
)

var LivePrefixState struct {
Expand Down
2 changes: 1 addition & 1 deletion _example/simple-echo/cjk-cyrillic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

prompt "github.com/c-bata/go-prompt"
prompt "github.com/elk-language/go-prompt"
)

func executor(in string) {
Expand Down
2 changes: 1 addition & 1 deletion _example/simple-echo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

prompt "github.com/c-bata/go-prompt"
prompt "github.com/elk-language/go-prompt"
)

func completer(in prompt.Document) []prompt.Suggest {
Expand Down
4 changes: 2 additions & 2 deletions _tools/complete_file/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"strings"

prompt "github.com/c-bata/go-prompt"
"github.com/c-bata/go-prompt/completer"
prompt "github.com/elk-language/go-prompt"
"github.com/elk-language/go-prompt/completer"
)

var filePathCompleter = completer.FilePathCompleter{
Expand Down
5 changes: 3 additions & 2 deletions _tools/vt100_debug/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package main
Expand All @@ -6,8 +7,8 @@ import (
"fmt"
"syscall"

prompt "github.com/c-bata/go-prompt"
"github.com/c-bata/go-prompt/internal/term"
prompt "github.com/elk-language/go-prompt"
"github.com/elk-language/go-prompt/internal/term"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package prompt
import (
"strings"

"github.com/c-bata/go-prompt/internal/debug"
"github.com/elk-language/go-prompt/internal/debug"
)

// Buffer emulates the console buffer.
Expand Down Expand Up @@ -49,7 +49,7 @@ func (b *Buffer) InsertText(v string, overwrite bool, moveCursor bool) {
if overwrite {
overwritten := string(or[oc:])
if len(overwritten) >= oc+len(v) {
overwritten = string(or[oc : oc+len(v)])
overwritten = string(or[oc : oc+len(v)])
}
if strings.Contains(overwritten, "\n") {
i := strings.IndexAny(overwritten, "\n")
Expand Down
4 changes: 2 additions & 2 deletions completer/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"path/filepath"
"runtime"

prompt "github.com/c-bata/go-prompt"
"github.com/c-bata/go-prompt/internal/debug"
prompt "github.com/elk-language/go-prompt"
"github.com/elk-language/go-prompt/internal/debug"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package prompt
import (
"strings"

"github.com/c-bata/go-prompt/internal/debug"
"github.com/elk-language/go-prompt/internal/debug"
runewidth "github.com/mattn/go-runewidth"
)

Expand Down
4 changes: 2 additions & 2 deletions document.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"strings"
"unicode/utf8"

"github.com/c-bata/go-prompt/internal/bisect"
istrings "github.com/c-bata/go-prompt/internal/strings"
"github.com/elk-language/go-prompt/internal/bisect"
istrings "github.com/elk-language/go-prompt/internal/strings"
runewidth "github.com/mattn/go-runewidth"
)

Expand Down
2 changes: 1 addition & 1 deletion document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func TestDocument_DisplayCursorPosition(t *testing.T) {
// If you're facing test failure on this test case and your terminal is iTerm2,
// please check 'Profile -> Text' configuration. 'Use Unicode version 9 widths'
// must be checked.
// https://github.com/c-bata/go-prompt/pull/99
// https://github.com/elk-language/go-prompt/pull/99
document: &Document{
Text: "Добрый день",
cursorPosition: 3,
Expand Down
2 changes: 1 addition & 1 deletion emacs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package prompt

import "github.com/c-bata/go-prompt/internal/debug"
import "github.com/elk-language/go-prompt/internal/debug"

/*
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/c-bata/go-prompt
module github.com/elk-language/go-prompt

go 1.14

Expand Down
2 changes: 1 addition & 1 deletion input_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"syscall"

"github.com/c-bata/go-prompt/internal/term"
"github.com/elk-language/go-prompt/internal/term"
"golang.org/x/sys/unix"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/bisect/bisect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math/rand"
"testing"

"github.com/c-bata/go-prompt/internal/bisect"
"github.com/elk-language/go-prompt/internal/bisect"
)

func Example() {
Expand Down
2 changes: 1 addition & 1 deletion internal/strings/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package strings_test
import (
"fmt"

"github.com/c-bata/go-prompt/internal/strings"
"github.com/elk-language/go-prompt/internal/strings"
)

func ExampleIndexNotByte() {
Expand Down
2 changes: 1 addition & 1 deletion output_vt100.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (w *VT100Writer) SetColor(fg, bg Color, bold bool) {
w.SetDisplayAttributes(fg, bg, DisplayBold)
} else {
// If using `DisplayDefualt`, it will be broken in some environment.
// Details are https://github.com/c-bata/go-prompt/pull/85
// Details are https://github.com/elk-language/go-prompt/pull/85
w.SetDisplayAttributes(fg, bg, DisplayReset)
}
}
Expand Down
2 changes: 1 addition & 1 deletion prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"unicode"
"unicode/utf8"

"github.com/c-bata/go-prompt/internal/debug"
"github.com/elk-language/go-prompt/internal/debug"
)

// Executor is called when the user
Expand Down
2 changes: 1 addition & 1 deletion render.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"runtime"
"strings"

"github.com/c-bata/go-prompt/internal/debug"
"github.com/elk-language/go-prompt/internal/debug"
runewidth "github.com/mattn/go-runewidth"
)

Expand Down
3 changes: 2 additions & 1 deletion signal_posix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package prompt
Expand All @@ -7,7 +8,7 @@ import (
"os/signal"
"syscall"

"github.com/c-bata/go-prompt/internal/debug"
"github.com/elk-language/go-prompt/internal/debug"
)

func (p *Prompt) handleSignals(exitCh chan int, winSizeCh chan *WinSize, stop chan struct{}) {
Expand Down
3 changes: 2 additions & 1 deletion signal_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package prompt
Expand All @@ -7,7 +8,7 @@ import (
"os/signal"
"syscall"

"github.com/c-bata/go-prompt/internal/debug"
"github.com/elk-language/go-prompt/internal/debug"
)

func (p *Prompt) handleSignals(exitCh chan int, winSizeCh chan *WinSize, stop chan struct{}) {
Expand Down

0 comments on commit ce04c63

Please sign in to comment.