func main() {
	input := common.PluginInput{}

	if len(os.Args) < 2 {
		inData, _ := io.ReadAll(os.Stdin)
		log.Debugf("Raw input: %s", string(inData))
		decodeErr := json.Unmarshal(inData, &input)

		if decodeErr != nil {
			panic("missing mode argument")
		}
	} else {
		log.Debug("Using command line inputs")
		mode := os.Args[1]
		log.Debugf("Command line inputs: %v", os.Args[1:])
		input.Args = common.ArgsMap{
			"mode": mode,
		}

		// just some hard-coded values
		input.ServerConnection = common.StashServerConnection{
			Scheme: "http",
			Port:   9999,
		}
	}

	output := common.PluginOutput{}
	Run(input, &output)

	out, _ := json.Marshal(output)
	os.Stdout.WriteString(string(out))
}
// raw plugins may accept the plugin input from stdin, or they can elect
// to ignore it entirely. In this case it optionally reads from the
// command-line parameters.
raw plugins may accept the plugin input from stdin, or they can elect
to ignore it entirely. In this case it optionally reads from the
command-line parameters.
// raw plugins may accept the plugin input from stdin or they can elect // to ignore it entirely . In this case it optionally reads from the // command - line parameters .
func main() {
	input := common.PluginInput{}
	if len(os.Args) < 2 {
		inData, _ := io.ReadAll(os.Stdin)
		log.Debugf("Raw input: %s", string(inData))
		decodeErr := json.Unmarshal(inData, &input)
		if decodeErr != nil {
			panic("missing mode argument")
		}
	} else {
		log.Debug("Using command line inputs")
		mode := os.Args[1]
		log.Debugf("Command line inputs: %v", os.Args[1:])
		input.Args = common.ArgsMap{
			"mode": mode,
		}
		input.ServerConnection = common.StashServerConnection{
			Scheme: "http",
			Port:   9999,
		}
	}
	output := common.PluginOutput{}
	Run(input, &output)
	out, _ := json.Marshal(output)
	os.Stdout.WriteString(string(out))
}
func main ( ) { input := common . PluginInput { } if len ( os . Args ) < 2 { inData , _ := io . ReadAll ( os . Stdin ) log . Debugf ( " " , string ( inData ) ) decodeErr := json . Unmarshal ( inData , & input ) if decodeErr != nil { panic ( " " ) } } else { log . Debug ( " " ) mode := os . Args [ 1 ] log . Debugf ( " " , os . Args [ 1 : ] ) input . Args = common . ArgsMap { " " : mode , } input . ServerConnection = common . StashServerConnection { Scheme : " " , Port : 9999 , } } output := common . PluginOutput { } Run ( input , & output ) out , _ := json . Marshal ( output ) os . Stdout . WriteString ( string ( out ) ) }
raw plugins may accept the plugin input from stdin, or they can elect
to ignore it entirely.
raw plugins may accept the plugin input from stdin or they can elect to ignore it entirely .
// just some hard-coded values