set_base_url

package
v1.1.6-nightly Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:    "setbaseurl",
	Short:  "set base url for the cli",
	Hidden: true,
	Run: func(cmd *cobra.Command, args []string) {
		fc := clients.File
		if b := fn.ParseBoolFlag(cmd, "reset"); b {
			if err := fc.SaveBaseURL(flags.DefaultBaseURL); err != nil {
				fn.PrintError(err)
			} else {
				fn.Log("Base url reset successfully")
			}

			return
		}

		b := functions.ParseBoolFlag(cmd, "check")
		if b {
			fn.Println(constants.BaseURL)
			return
		}

		if len(args) == 0 {
			fn.Log(text.Yellow("Please provide a base url"))
			return
		}

		if err := fc.SaveBaseURL(args[0]); err != nil {
			fn.PrintError(err)
		} else {
			fn.Log("Base url set successfully")
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL