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/
*.exe *.exe
*.swp *.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= surdeus.su/core/cli v0.1.2 h1:qPzjawqPyZsO4Z5SaA1u141recVE65yioA83Qs7Jecs=
github.com/di4f/cli v0.0.0-20231214183522-32f786133a58/go.mod h1:a2hUcQVjIEYR0VW3gf640cgbxCvUwA9vwKvkSkw1SUU= 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 ( import (
"fmt" "fmt"
"github.com/di4f/cli/mtool" "surdeus.su/core/cli/mtool"
"github.com/di4f/bb/tool/cat" "surdeus.su/util/bb/tool/cat"
"github.com/di4f/bb/tool/date" "surdeus.su/util/bb/tool/date"
"github.com/di4f/bb/tool/ec" "surdeus.su/util/bb/tool/ec"
"github.com/di4f/bb/tool/echo" "surdeus.su/util/bb/tool/echo"
"github.com/di4f/bb/tool/ftest" "surdeus.su/util/bb/tool/ftest"
"github.com/di4f/bb/tool/grange" "surdeus.su/util/bb/tool/grange"
"github.com/di4f/bb/tool/in" "surdeus.su/util/bb/tool/in"
"github.com/di4f/bb/tool/ln" "surdeus.su/util/bb/tool/ln"
"github.com/di4f/bb/tool/ls" "surdeus.su/util/bb/tool/ls"
"github.com/di4f/bb/tool/mergelbl" "surdeus.su/util/bb/tool/mergelbl"
"github.com/di4f/bb/tool/mkdir" "surdeus.su/util/bb/tool/mkdir"
"github.com/di4f/bb/tool/paths" "surdeus.su/util/bb/tool/paths"
"github.com/di4f/bb/tool/quote" "surdeus.su/util/bb/tool/quote"
"github.com/di4f/bb/tool/read" "surdeus.su/util/bb/tool/read"
"github.com/di4f/bb/tool/sort" "surdeus.su/util/bb/tool/sort"
"github.com/di4f/bb/tool/tac" "surdeus.su/util/bb/tool/tac"
"github.com/di4f/bb/tool/uniq" "surdeus.su/util/bb/tool/uniq"
"github.com/di4f/bb/tool/urlprs" "surdeus.su/util/bb/tool/urlprs"
"github.com/di4f/bb/tool/useprog" "surdeus.su/util/bb/tool/useprog"
"github.com/di4f/bb/tool/wc" "surdeus.su/util/bb/tool/wc"
"github.com/di4f/bb/tool/whoami" "surdeus.su/util/bb/tool/whoami"
"github.com/di4f/bb/tool/yes" "surdeus.su/util/bb/tool/yes"
"os" "os"
) )
@ -121,7 +121,10 @@ var root = mtool.T("bb").Subs(
), ),
).Desc( ).Desc(
"not POSIX compatible BusyBox utilities", "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() { func main() {
root.Run(os.Args[1:]) root.Run(os.Args[1:])

View file

@ -1,6 +1,6 @@
# tk # 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 Gopher ToolKit. Not POSIX compatible BusyBox-like set of programs

View file

@ -1,13 +1,15 @@
package cat package cat
/* Concatenate files in "stdout". */ /* Concatenate files in "stdout". */
import( import (
"os"
"io"
"fmt" "fmt"
"github.com/di4f/cli/mtool" "io"
"os"
"surdeus.su/core/cli/mtool"
) )
var( var (
blockSize int blockSize int
) )

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,8 +5,8 @@ import (
"os" "os"
"fmt" "fmt"
"strings" "strings"
"github.com/di4f/bb/input" "surdeus.su/util/bb/input"
"github.com/di4f/cli/mtool" "surdeus.su/core/cli/mtool"
) )
var ( 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)
}