1 Star 0 Fork 0

坐公交也用券 / gcs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
shellBase.go 867 Bytes
一键复制 编辑 原始数据 按行查看 历史
liumou 提交于 2023-02-07 23:45 . 完成脚本执行方式
package gcs
import (
"fmt"
"strings"
"gitee.com/liumou_site/gbm"
)
// Grep 通过关键词筛选所有匹配行
func (api *ApiShell) Grep(match string) *ApiShell {
api.gfs.Text = api.Strings
api.gfs.Grep(match)
api.Strings = api.gfs.Text
api.Err = api.gfs.Err
r := strings.Split(api.Strings, "\n")
api.Slice = gbm.SliceRemoveNull(r)
api.Err = api.gfs.Err
return api
}
// Echo 打印命令执行反馈信息
func (api *ApiShell) Echo() {
fmt.Println(api.Strings)
}
// Line 截取指定行
func (api *ApiShell) Line(n int) *ApiShell {
api.gfs.Text = api.Strings
api.gfs.Line(n)
api.Strings = api.gfs.Text
api.Err = api.gfs.Err
return api
}
// Column 截取指定列
func (api *ApiShell) Column(col int, sep string) *ApiShell {
api.gfs.Text = api.Strings
api.gfs.Column(col, sep)
api.Strings = api.gfs.Text
api.Err = api.gfs.Err
return api
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/liumou_site/gcs.git
git@gitee.com:liumou_site/gcs.git
liumou_site
gcs
gcs
v1.7.2

搜索帮助

344bd9b3 5694891 D2dac590 5694891