summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go6
-rw-r--r--model_list.go (renamed from model_drafts.go)4
2 files changed, 5 insertions, 5 deletions
diff --git a/main.go b/main.go
index 72f3b23..5eadcfb 100644
--- a/main.go
+++ b/main.go
@@ -14,12 +14,12 @@ func main() {
args := os.Args
if len(args) == 1 {
- p = tea.NewProgram(initialModel())
+ p = tea.NewProgram(listModel("all"))
} else {
subcmd := args[1]
switch subcmd {
- case "drafts":
- p = tea.NewProgram(initialModel())
+ case "drafts", "all", "expired", "future", "published":
+ p = tea.NewProgram(listModel(subcmd))
}
}
diff --git a/model_drafts.go b/model_list.go
index c796e98..f2c6a72 100644
--- a/model_drafts.go
+++ b/model_list.go
@@ -15,8 +15,8 @@ type model struct {
selected map[int]struct{}
}
-func initialModel() model {
- out, err := exec.Command("hugo", "list", "drafts").Output()
+func listModel(arg string) model {
+ out, err := exec.Command("hugo", "list", arg).Output()
if err != nil {
println("Error fetching Hugo drafts: Is this a Hugo site? Is Hugo installed?")
os.Exit(1)