Skip to content

Commit

Permalink
Use RESH instead of Resh
Browse files Browse the repository at this point in the history
  • Loading branch information
curusarn committed Feb 26, 2023
1 parent ebfc456 commit 30b254c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func runReshCli(out *output.Output, config cfg.Config) (string, int) {

const missing = "<missing cdxgtcpboqwrdom>"
flags := pflag.NewFlagSet("", pflag.ExitOnError)
sessionID := flags.String("session-id", missing, "Resh generated session ID")
sessionID := flags.String("session-id", missing, "RESH generated session ID")
pwd := flags.String("pwd", missing, "$PWD - present working directory")
gitOriginRemote := flags.String("git-remote", missing, "> git remote get-url origin")
query := flags.String("query", "", "Search query")
Expand Down
4 changes: 2 additions & 2 deletions cmd/collect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func main() {
gitRemote := flags.String("git-remote", "", "> git remote get-url origin")
home := flags.String("home", "", "$HOME")
pwd := flags.String("pwd", "", "$PWD - present working directory")
recordID := flags.String("record-id", "", "Resh generated record ID")
sessionID := flags.String("session-id", "", "Resh generated session ID")
recordID := flags.String("record-id", "", "RESH generated record ID")
sessionID := flags.String("session-id", "", "RESH generated session ID")
sessionPID := flags.Int("session-pid", -1, "$$ - Shell session PID")
shell := flags.String("shell", "", "Current shell")
shlvl := flags.Int("shlvl", -1, "$SHLVL")
Expand Down
4 changes: 2 additions & 2 deletions cmd/postcollect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func main() {

flags := pflag.NewFlagSet("", pflag.ExitOnError)
exitCode := flags.Int("exit-code", -1, "Exit code")
sessionID := flags.String("session-id", "", "Resh generated session ID")
recordID := flags.String("record-id", "", "Resh generated record ID")
sessionID := flags.String("session-id", "", "RESH generated session ID")
recordID := flags.String("record-id", "", "RESH generated record ID")
shlvl := flags.Int("shlvl", -1, "$SHLVL")
rtb := flags.String("time-before", "-1", "Before $EPOCHREALTIME")
rta := flags.String("time-after", "-1", "After $EPOCHREALTIME")
Expand Down
2 changes: 1 addition & 1 deletion cmd/session-init/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
args := opt.HandleVersionOpts(out, os.Args, version, commit)

flags := pflag.NewFlagSet("", pflag.ExitOnError)
sessionID := flags.String("session-id", "", "Resh generated session ID")
sessionID := flags.String("session-id", "", "RESH generated session ID")
sessionPID := flags.Int("session-pid", -1, "$$ - Shell session PID")
flags.Parse(args)

Expand Down
8 changes: 4 additions & 4 deletions internal/histfile/histfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (h *Histfile) loadCliRecords(recs []record.V1) {
rec := recs[i]
h.cliRecords.AddRecord(&rec)
}
h.sugar.Infow("Resh history loaded",
h.sugar.Infow("RESH history loaded",
"historyRecordsCount", len(h.cliRecords.List),
)
}
Expand All @@ -87,7 +87,7 @@ func (h *Histfile) loadHistory(bashHistoryPath, zshHistoryPath string, maxInitHi
useNativeHistories := false
if size/1024 < minInitHistSizeKB {
useNativeHistories = true
h.sugar.Warnw("Resh_history is too small - loading native bash and zsh history ...")
h.sugar.Warnw("RESH history is too small - loading native bash and zsh history ...")
h.bashCmdLines = records.LoadCmdLinesFromBashFile(h.sugar, bashHistoryPath)
h.sugar.Infow("Bash history loaded", "cmdLineCount", len(h.bashCmdLines.List))
h.zshCmdLines = records.LoadCmdLinesFromZshFile(h.sugar, zshHistoryPath)
Expand All @@ -102,15 +102,15 @@ func (h *Histfile) loadHistory(bashHistoryPath, zshHistoryPath string, maxInitHi
if err != nil {
h.sugar.Fatalf("Failed to read history file: %v", err)
}
h.sugar.Infow("Resh history loaded from file",
h.sugar.Infow("RESH history loaded from file",
"historyFile", h.historyPath,
"recordCount", len(history),
)
go h.loadCliRecords(history)
// NOTE: keeping this weird interface for now because we might use it in the future
// when we only load bash or zsh history
reshCmdLines := loadCmdLines(h.sugar, history)
h.sugar.Infow("Resh history loaded and processed",
h.sugar.Infow("RESH history loaded and processed",
"recordCount", len(reshCmdLines.List),
)
if !useNativeHistories {
Expand Down
2 changes: 1 addition & 1 deletion scripts/rawinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ echo " * Latest version: $version (git tag: $tag)"

# TODO: compare semanitcally instead of just using equality
if [ "${__RESH_VERSION:-}" == "$version" ]; then
echo " * Resh is up to date - nothing to do - exiting."
echo " * RESH is up to date - nothing to do - exiting."
exit 0
fi

Expand Down

0 comments on commit 30b254c

Please sign in to comment.