Documentation ¶
Index ¶
- func HandleDataFlag(cmd *cobra.Command, fs afero.Fs) (io.ReadCloser, error)
- func HandleEditFlag(cmd *cobra.Command, fs afero.Fs, cfg *config.Config) (editor.Editor, error)
- func HandleOutputFlag(cmd *cobra.Command, fs afero.Fs) (io.WriteCloser, error)
- func RegisterDataFlag(cmd *cobra.Command)
- func RegisterEditFlag(cmd *cobra.Command)
- func RegisterOutputFlag(cmd *cobra.Command)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleDataFlag ¶
HandleDataFlag returns an io.ReadCloser for the data specified in the flag. If the data flag is "-", the data will be read from stdin. If the data flag starts with "@", it opens the file specified in the flag. Otherwise, it returns the provided data string.
func HandleEditFlag ¶
HandleEditFlag returns an editor.Editor instance if the edit flag is set. Otherwise it returns nil. The actual editor used is determined by configuration or, if not set, nano is used by default.
func HandleOutputFlag ¶
HandleOutputFlag returns an io.WriteCloser that represents the output destination.
func RegisterDataFlag ¶
RegisterDataFlag registers the data flag with the provided command. The flag allows the user to specify request data.
func RegisterEditFlag ¶
RegisterEditFlag registers the edit flag for a given command. The flag allows the user edit input with a text editor of choice.
func RegisterOutputFlag ¶
RegisterOutputFlag registers the output flag for a given command. The flag allows the user to specify an output file to write to.
Types ¶
This section is empty.