backstack: have added the workspace flag

This commit is contained in:
Leon Mika 2022-08-14 09:20:24 +10:00
parent 6c5787b271
commit cc58db2d49
2 changed files with 15 additions and 8 deletions

View file

@ -28,6 +28,7 @@ func main() {
var flagTable = flag.String("t", "", "dynamodb table name")
var flagLocal = flag.String("local", "", "local endpoint")
var flagDebug = flag.String("debug", "", "file to log debug messages")
var flagWorkspace = flag.String("w", "", "workspace file")
flag.Parse()
ctx := context.Background()
@ -37,11 +38,11 @@ func main() {
cli.Fatalf("cannot load AWS config: %v", err)
}
wsManager := workspaces.New(workspaces.MetaInfo{
Command: "sqs-browse",
})
//ws, err := wsManager.CreateTemp()
ws, err := wsManager.Open("temp.workspace")
closeFn := logging.EnableLogging(*flagDebug)
defer closeFn()
wsManager := workspaces.New(workspaces.MetaInfo{Command: "dynamo-browse"})
ws, err := wsManager.OpenOrCreate(*flagWorkspace)
if err != nil {
cli.Fatalf("cannot create workspace: %v", ws)
}
@ -83,9 +84,6 @@ func main() {
p := tea.NewProgram(model, tea.WithAltScreen())
closeFn := logging.EnableLogging(*flagDebug)
defer closeFn()
// Pre-determine if layout has dark background. This prevents calls for creating a list to hang.
if lipgloss.HasDarkBackground() {
if colorScheme := osstyle.CurrentColorScheme(); colorScheme == osstyle.ColorSchemeLightMode {