Compare commits

...

10 commits
master ... main

Author SHA1 Message Date
b5d6c67685 started using zed 2024-09-01 00:02:47 +05:00
bdf1fd0ceb feat: updated surdeus.su/core/cli. 2024-07-21 02:58:36 +05:00
5acf5ebb55 fix: we do not need xgo here after all. 2024-06-06 22:50:22 +05:00
11fde8986c feat: upgraded xgo. 2024-06-06 22:40:12 +05:00
a88986a89e feat: update xgo. 2024-06-06 11:14:30 +05:00
cd6a9131c0 new domain. 2024-05-15 23:07:35 +05:00
d286351445 feat: added the "bb ls -R" flag. 2024-01-24 20:34:01 +03:00
702e8e05af Repository transfering. 2024-01-05 03:45:34 +03:00
fb5a0257db feat: FINALLY WE HAVE OUR OWN SERVICE! 2024-01-05 03:22:55 +03:00
1522cce6e1 ... 2024-01-04 17:13:03 +03:00
32 changed files with 89 additions and 67 deletions

2
.gitignore vendored
View file

@ -1,4 +1,4 @@
exe/
*.exe
*.swp
/bb

6
go.mod
View file

@ -1,5 +1,5 @@
module github.com/di4f/bb
module surdeus.su/util/bb
go 1.18
go 1.22.3
require github.com/di4f/cli v0.0.0-20231214183522-32f786133a58
require surdeus.su/core/cli v0.5.0

8
go.sum
View file

@ -1,2 +1,6 @@
github.com/di4f/cli v0.0.0-20231214183522-32f786133a58 h1:b3bk2zD7YqLJDYoNAGawVbJovkNzJPDULYuF6+ar09w=
github.com/di4f/cli v0.0.0-20231214183522-32f786133a58/go.mod h1:a2hUcQVjIEYR0VW3gf640cgbxCvUwA9vwKvkSkw1SUU=
surdeus.su/core/cli v0.1.2 h1:qPzjawqPyZsO4Z5SaA1u141recVE65yioA83Qs7Jecs=
surdeus.su/core/cli v0.1.2/go.mod h1:r9JtQz3aEJzpYzMaNUNQHJoYkoWKNPi047qhd5uGlmA=
surdeus.su/core/cli v0.3.0 h1:/2UfObbesg3/2FPn/9Ys/w/H2XOxOv72ehidwctAGdM=
surdeus.su/core/cli v0.3.0/go.mod h1:r9JtQz3aEJzpYzMaNUNQHJoYkoWKNPi047qhd5uGlmA=
surdeus.su/core/cli v0.5.0 h1:jYvE0JVDikFT9FhWGV3wIAcMgByziAVxTwsVUwWkeHs=
surdeus.su/core/cli v0.5.0/go.mod h1:r9JtQz3aEJzpYzMaNUNQHJoYkoWKNPi047qhd5uGlmA=

51
main.go
View file

@ -2,30 +2,30 @@ package main
import (
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
"github.com/di4f/bb/tool/cat"
"github.com/di4f/bb/tool/date"
"github.com/di4f/bb/tool/ec"
"github.com/di4f/bb/tool/echo"
"github.com/di4f/bb/tool/ftest"
"github.com/di4f/bb/tool/grange"
"github.com/di4f/bb/tool/in"
"github.com/di4f/bb/tool/ln"
"github.com/di4f/bb/tool/ls"
"github.com/di4f/bb/tool/mergelbl"
"github.com/di4f/bb/tool/mkdir"
"github.com/di4f/bb/tool/paths"
"github.com/di4f/bb/tool/quote"
"github.com/di4f/bb/tool/read"
"github.com/di4f/bb/tool/sort"
"github.com/di4f/bb/tool/tac"
"github.com/di4f/bb/tool/uniq"
"github.com/di4f/bb/tool/urlprs"
"github.com/di4f/bb/tool/useprog"
"github.com/di4f/bb/tool/wc"
"github.com/di4f/bb/tool/whoami"
"github.com/di4f/bb/tool/yes"
"surdeus.su/util/bb/tool/cat"
"surdeus.su/util/bb/tool/date"
"surdeus.su/util/bb/tool/ec"
"surdeus.su/util/bb/tool/echo"
"surdeus.su/util/bb/tool/ftest"
"surdeus.su/util/bb/tool/grange"
"surdeus.su/util/bb/tool/in"
"surdeus.su/util/bb/tool/ln"
"surdeus.su/util/bb/tool/ls"
"surdeus.su/util/bb/tool/mergelbl"
"surdeus.su/util/bb/tool/mkdir"
"surdeus.su/util/bb/tool/paths"
"surdeus.su/util/bb/tool/quote"
"surdeus.su/util/bb/tool/read"
"surdeus.su/util/bb/tool/sort"
"surdeus.su/util/bb/tool/tac"
"surdeus.su/util/bb/tool/uniq"
"surdeus.su/util/bb/tool/urlprs"
"surdeus.su/util/bb/tool/useprog"
"surdeus.su/util/bb/tool/wc"
"surdeus.su/util/bb/tool/whoami"
"surdeus.su/util/bb/tool/yes"
"os"
)
@ -121,7 +121,10 @@ var root = mtool.T("bb").Subs(
),
).Desc(
"not POSIX compatible BusyBox utilities",
)
).Ldesc(`
The program is not supposed to be a "BusyBox killer.".
In fact it just has better options for Surdeus's scripts.
`)
func main() {
root.Run(os.Args[1:])

View file

@ -1,6 +1,6 @@
# tk
![Insert here a gopher, please](https://raw.githubusercontent.com/di4f/tk//master/media/gopher.png)
![Insert here a gopher, please](https://raw.githubusercontent.com/vultras/tk//master/media/gopher.png)
Gopher ToolKit. Not POSIX compatible BusyBox-like set of programs

View file

@ -1,13 +1,15 @@
package cat
/* Concatenate files in "stdout". */
import(
"os"
"io"
import (
"fmt"
"github.com/di4f/cli/mtool"
"io"
"os"
"surdeus.su/core/cli/mtool"
)
var(
var (
blockSize int
)
@ -37,7 +39,7 @@ func fcat(f *os.File) error {
return nil
}
func Run(flags *mtool.Flags) {
func Run(flags *mtool.Flags) {
flags.IntVar(&blockSize, "bs", 512, "block size")
flags.Parse()
args := flags.Args()

View file

@ -3,7 +3,7 @@ package date
import(
"fmt"
"time"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func Run(flagSet *mtool.Flags) {

View file

@ -6,7 +6,7 @@ import(
"os"
"bufio"
"log"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
const(

View file

@ -3,7 +3,7 @@ package echo
import (
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var(

View file

@ -5,7 +5,7 @@ import (
"io"
"bufio"
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
"path/filepath"
)

View file

@ -5,7 +5,7 @@ import (
"io"
"bufio"
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
"path/filepath"
)

View file

@ -2,7 +2,7 @@ package gfalse
import(
"os"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func Run(flags *mtool.Flags) {

View file

@ -3,7 +3,7 @@ package grange
import(
"fmt"
"strconv"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var(

View file

@ -1,5 +1,5 @@
package gtrue
import "github.com/di4f/cli/mtool"
import "surdeus.su/core/cli/mtool"
func Run(flags *mtool.Flags) {}

View file

@ -5,7 +5,7 @@ import (
"io"
"bufio"
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func Run(flagSet *mtool.Flags) {

View file

@ -3,7 +3,7 @@ package ln
import (
"fmt"
"os"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
"path/filepath"
)

View file

@ -5,7 +5,7 @@ import(
"strings"
"regexp"
"path"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var(
@ -126,17 +126,24 @@ ls(p string, fold int) error {
func Run(flagSet *mtool.Flags) {
var foldLvl int
flagSet.IntVar(&foldLvl, "r", 1, "List recursively with choosing deepness, can't be negative or zero.")
flagSet.BoolVar(&listHidden, "a", false, "List hidden files.")
var rFlag bool
flagSet.BoolVar(&rFlag, "R", false, "set the '-r' flags value to the max depth (overrides the '-r')")
flagSet.IntVar(&foldLvl, "r", 1, "list recursively with choosing deepness, can't be negative or zero.")
flagSet.BoolVar(&listHidden, "a", false, "list hidden files.")
flagSet.Parse()
args = flagSet.Args()
if rFlag {
foldLvl = 9999999
}
if foldLvl<0 {
flagSet.Usage()
os.Exit(1)
}
if foldLvl==0 && len(args)==0 {
flagSet.Usage()
os.Exit(1)
}
if len(args) == 0 {

View file

@ -5,7 +5,7 @@ import(
"fmt"
"bufio"
"log"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func Run(flagSet *mtool.Flags) {

View file

@ -5,7 +5,7 @@ import (
"os"
"path/filepath"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func Run(flagSet *mtool.Flags) {

View file

@ -3,7 +3,7 @@ package noext
import(
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var(

View file

@ -9,9 +9,9 @@ import (
"path"
"strings"
//"github.com/di4f/tk/pathx"
//"surdeus.su/core/tk/pathx"
"path/filepath"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var (

View file

@ -7,7 +7,7 @@ import(
"fmt"
"unicode"
"bufio"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func HasWhiteSpace(s string) bool {

View file

@ -4,7 +4,7 @@ import(
"os"
"bufio"
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var(

View file

@ -4,8 +4,8 @@ import (
"fmt"
"os"
"sort"
"github.com/di4f/bb/input"
"github.com/di4f/cli/mtool"
"surdeus.su/util/bb/input"
"surdeus.su/core/cli/mtool"
)
func Run(flagSet *mtool.Flags) {

View file

@ -5,7 +5,7 @@ import(
"io"
"fmt"
"bufio"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func reverse(a []string) chan string {

View file

@ -6,7 +6,7 @@ import(
"fmt"
"bufio"
"io"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func Run(flagSet *mtool.Flags) {

View file

@ -5,7 +5,7 @@ import (
"fmt"
"net"
"net/url"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var nilStr = "_"

View file

@ -4,7 +4,7 @@ import (
"os"
"os/exec"
"fmt"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
"path/filepath"
)

View file

@ -7,7 +7,7 @@ import (
"fmt"
"unicode"
"strconv"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
var (

View file

@ -5,7 +5,7 @@ import(
"os/user"
"fmt"
"log"
"github.com/di4f/cli/mtool"
"surdeus.su/core/cli/mtool"
)
func Run(flagSet *mtool.Flags) {

View file

@ -5,8 +5,8 @@ import (
"os"
"fmt"
"strings"
"github.com/di4f/bb/input"
"github.com/di4f/cli/mtool"
"surdeus.su/util/bb/input"
"surdeus.su/core/cli/mtool"
)
var (

6
xgo_test.xgo Normal file
View file

@ -0,0 +1,6 @@
fmt := import("fmt")
fmt.println("Hello, World!")
for _, i in [15, 573, 53] {
fmt.println(i)
}