mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-19 20:10:58 +01:00
Appears to be a functional migration to cobra
This commit is contained in:
parent
0667494239
commit
be2cde72c2
@ -3,7 +3,6 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ddworken/hishtory/client/hctx"
|
"github.com/ddworken/hishtory/client/hctx"
|
||||||
@ -57,7 +56,7 @@ var exportCmd = &cobra.Command{
|
|||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
ctx := hctx.MakeContext()
|
ctx := hctx.MakeContext()
|
||||||
lib.CheckFatalError(lib.ProcessDeletionRequests(ctx))
|
lib.CheckFatalError(lib.ProcessDeletionRequests(ctx))
|
||||||
export(ctx, strings.Join(os.Args[2:], " "))
|
export(ctx, strings.Join(args, " "))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ var saveHistoryEntryCmd = &cobra.Command{
|
|||||||
Use: "saveHistoryEntry",
|
Use: "saveHistoryEntry",
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
Short: "[Internal-only] The command used to save history entries",
|
Short: "[Internal-only] The command used to save history entries",
|
||||||
|
DisableFlagParsing: true,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
ctx := hctx.MakeContext()
|
ctx := hctx.MakeContext()
|
||||||
lib.CheckFatalError(maybeUploadSkippedHistoryEntries(ctx))
|
lib.CheckFatalError(maybeUploadSkippedHistoryEntries(ctx))
|
||||||
|
@ -8,9 +8,4 @@ func main() {
|
|||||||
cmd.Execute()
|
cmd.Execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(feature): Add a session_id column that corresponds to the shell session the command was run in
|
// TODO(feature): Add a session_id column that corresponds to the shell session the command was run in
|
||||||
|
|
||||||
/*
|
|
||||||
Remaining things:
|
|
||||||
* Acutally migrate saveHistoryEntry to cobra
|
|
||||||
*/
|
|
Loading…
Reference in New Issue
Block a user