- added form list
- added sort by time
- fixed hanging channel in zip writer
- removed download url from form template
- added upload description
- added linter to Makefiles
- added missing test file
This commit is contained in:
2023-03-29 19:04:01 +02:00
parent c6f2b3f57c
commit 4aac69d425
16 changed files with 142 additions and 30 deletions

View File

@@ -19,6 +19,7 @@ package cmd
import (
//"errors"
"github.com/spf13/cobra"
"github.com/tlinden/ephemerup/common"
"github.com/tlinden/ephemerup/upctl/cfg"
"github.com/tlinden/ephemerup/upctl/lib"
"os"
@@ -43,6 +44,7 @@ func FormCommand(conf *cfg.Config) *cobra.Command {
formCmd.Aliases = append(formCmd.Aliases, "f")
formCmd.AddCommand(FormCreateCommand(conf))
formCmd.AddCommand(FormListCommand(conf))
return formCmd
}
@@ -70,3 +72,25 @@ func FormCreateCommand(conf *cfg.Config) *cobra.Command {
return formCreateCmd
}
func FormListCommand(conf *cfg.Config) *cobra.Command {
var listCmd = &cobra.Command{
Use: "list [options]",
Short: "List formss",
Long: `List formss.`,
RunE: func(cmd *cobra.Command, args []string) error {
// errors at this stage do not cause the usage to be shown
cmd.SilenceUsage = true
return lib.List(os.Stdout, conf, nil, common.TypeForm)
},
}
// options
listCmd.PersistentFlags().StringVarP(&conf.Apicontext, "apicontext", "", "", "Filter by given API context")
listCmd.Aliases = append(listCmd.Aliases, "ls")
listCmd.Aliases = append(listCmd.Aliases, "l")
return listCmd
}