From: Banana Date: Thu, 25 Jul 2024 20:13:45 +0000 (+0200) Subject: go client edit and edit list commands X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=b15406cccf981b30c02292ad92d8e6fca7476ec5;p=scientia.git go client edit and edit list commands adding get endpoint.php Signed-off-by: Banana --- diff --git a/client/go-cli/scientia/cmd/edit.go b/client/go-cli/scientia/cmd/edit.go new file mode 100644 index 0000000..872272e --- /dev/null +++ b/client/go-cli/scientia/cmd/edit.go @@ -0,0 +1,38 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "os" +) + +/** + * scientia + * + * Copyright 2023 - 2024 Johannes Keßler + * + * https://www.bananas-playground.net/projekt/scientia/ + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE + * + * You should have received a copy of the + * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + * along with this program. If not, see http://www.sun.com/cddl/cddl.html + */ + +var editCmd = &cobra.Command { + Use: "edit", + Short: "Modify an entry", + Long: "Edit an existing entry.", + Run: func(cmd *cobra.Command, args []string) { + if len(args) == 0 { + cmd.Help() + os.Exit(0) + } + }, +} + +func init() { + rootCmd.AddCommand(editCmd) +} diff --git a/client/go-cli/scientia/cmd/edit_list.go b/client/go-cli/scientia/cmd/edit_list.go new file mode 100644 index 0000000..e7adfe2 --- /dev/null +++ b/client/go-cli/scientia/cmd/edit_list.go @@ -0,0 +1,45 @@ +package cmd + +import ( + "fmt" + "github.com/spf13/cobra" +) + +/** + * scientia + * + * Copyright 2023 - 2024 Johannes Keßler + * + * https://www.bananas-playground.net/projekt/scientia/ + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE + * + * You should have received a copy of the + * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + * along with this program. If not, see http://www.sun.com/cddl/cddl.html + */ + + +// Subcommand of edit +// to list all available entries + +var editListCmd = &cobra.Command { + Use: "list", + Short: "List all available entries", + Long: "List all available entries", + Run: func(cmd *cobra.Command, args []string) { + listEntries() + }, +} + +func init() { + editCmd.AddCommand(editListCmd) +} + +func listEntries() { + if FlagVerbose { + fmt.Println("Starting to request entries") + } +} diff --git a/webroot/get.php b/webroot/get.php new file mode 100644 index 0000000..c9ae3a3 --- /dev/null +++ b/webroot/get.php @@ -0,0 +1,52 @@ +