summaryrefslogtreecommitdiffstats
path: root/commands/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/list.go')
-rw-r--r--commands/list.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/commands/list.go b/commands/list.go
index 8debe5ca5..b90a357f8 100644
--- a/commands/list.go
+++ b/commands/list.go
@@ -26,6 +26,7 @@ import (
"github.com/gohugoio/hugo/hugolib"
"github.com/gohugoio/hugo/resources/page"
"github.com/gohugoio/hugo/resources/resource"
+ "github.com/spf13/cobra"
)
// newListCommand creates a new list command and its subcommands.
@@ -102,6 +103,9 @@ func newListCommand() *listCommand {
"buildExpired", true,
)
},
+ withc: func(cmd *cobra.Command, r *rootCommand) {
+ cmd.ValidArgsFunction = cobra.NoFileCompletions
+ },
},
&simpleCommand{
name: "future",
@@ -119,6 +123,9 @@ func newListCommand() *listCommand {
"buildDrafts", true,
)
},
+ withc: func(cmd *cobra.Command, r *rootCommand) {
+ cmd.ValidArgsFunction = cobra.NoFileCompletions
+ },
},
&simpleCommand{
name: "expired",
@@ -136,6 +143,9 @@ func newListCommand() *listCommand {
"buildDrafts", true,
)
},
+ withc: func(cmd *cobra.Command, r *rootCommand) {
+ cmd.ValidArgsFunction = cobra.NoFileCompletions
+ },
},
&simpleCommand{
name: "all",
@@ -147,6 +157,9 @@ func newListCommand() *listCommand {
}
return list(cd, r, shouldInclude, "buildDrafts", true, "buildFuture", true, "buildExpired", true)
},
+ withc: func(cmd *cobra.Command, r *rootCommand) {
+ cmd.ValidArgsFunction = cobra.NoFileCompletions
+ },
},
},
}