// NewCmdVersion implements the S2i cli version command.
168947
func NewCmdVersion() *cobra.Command {
	return &cobra.Command{
		Use:   "version",
		Short: "Display version",
		Long:  "Display version",
		Run: func(cmd *cobra.Command, args []string) {
			fmt.Printf("s2i %v\n", version.Get())
		},
	}
}
1320817
func NewVersion(ver string) (version Version) {
	var err error

	// Parse epoch
	splitted := strings.SplitN(ver, ":", 2)
	if len(splitted) == 1 {
		version.epoch = 0
		ver = splitted[0]
	} else {
		// Trim left space
		epoch := strings.TrimLeftFunc(splitted[0], unicode.IsSpace)

		version.epoch, err = strconv.Atoi(epoch)
		if err != nil {
			version.epoch = 0
		}

		ver = splitted[1]
	}

	// Parse version and release
	index := strings.Index(ver, "-")
	if index >= 0 {
		version.version = ver[:index]
		version.release = ver[index+1:]

	} else {
		version.version = ver
	}

	return version
}
835390
func (cli *Client) NewVersionError(APIrequired, feature string) error {
	if cli.version != "" && versions.LessThan(cli.version, APIrequired) {
		return fmt.Errorf("%q requires API version %s, but the Docker daemon API version is %s", feature, APIrequired, cli.version)
	}
	return nil
}
464389
func SystemdVersion(systemdBinaryPath string) (int, error) {
	versionBytes, err := exec.Command(systemdBinaryPath, "--version").CombinedOutput()
	if err != nil {
		return -1, errwrap.Wrap(fmt.Errorf("unable to probe %s version", systemdBinaryPath), err)
	}
	versionStr := strings.SplitN(string(versionBytes), "\n", 2)[0]
	var version int
	n, err := fmt.Sscanf(versionStr, "systemd %d", &version)
	if err != nil || n != 1 {
		return -1, fmt.Errorf("cannot parse version: %q", versionStr)
	}

	return version, nil
}
748949
func NewCmd(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
	image := &cobra.Command{
		Use:   "registry COMMAND",
		Short: "Commands for working with the registry",
		Long:  imageLong,
		Run:   kcmdutil.DefaultSubCommandRun(streams.ErrOut),
	}

	name := fmt.Sprintf("%s registry", fullName)

	groups := ktemplates.CommandGroups{
		{
			Message: "Advanced commands:",
			Commands: []*cobra.Command{
				info.NewRegistryInfoCmd(name, f, streams),
				login.NewRegistryLoginCmd(name, f, streams),
			},
		},
	}
	groups.Add(image)
	templates.ActsAsRootCommand(image, []string{"options"}, groups...)
	return image
}
213075
func CheckVersion(minVersion []int) Check {
	return func() error {
		cli, err := newClient()
		if err != nil {
			return fmt.Errorf("creating client: %v", err)
		}
		v, err := cli.Version()
		if err != nil {
			return fmt.Errorf("getting version: %v", err)
		}
		return versionAtLeast(v.Version, minVersion)
	}
}
138536
func GetVersion() (int, error) {
	output, err := cmd("", "--version")
	if err != nil {
		return -1, err
	}

	return parseVersion(output)
}
1191741
func (cli *Cli) Version(name, version string) {
	cli.Bool(BoolOpt{
		Name:      name,
		Value:     false,
		Desc:      "Show the version and exit",
		HideValue: true,
	})
	names := mkOptStrs(name)
	option := cli.optionsIdx[names[0]]
	cli.version = &cliVersion{version, option}
}
988128
func VersionCommand(factory app.ProjectFactory) cli.Command {
	return cli.Command{
		Name:   "version",
		Usage:  "Show version informations",
		Action: app.Version,
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "short",
				Usage: "Shows only Compose's version number.",
			},
		},
	}
}
1326203
func newVersionInconsistentError(currentVersion version.Number, agents []string) *versionInconsistentError {
	return &versionInconsistentError{currentVersion, agents}
}
815596
func NewApplicationVersionSetCommand(ctx Context) (cmd.Command, error) {
	cmd := &applicationVersionSetCommand{ctx: ctx}
	return cmd, nil
}
155728
func NewCmdCreate() *cobra.Command {
	return &cobra.Command{
		Use:   "create <imageName> <destination>",
		Short: "Bootstrap a new S2I image repository",
		Long:  "Bootstrap a new S2I image with given imageName inside the destination directory",
		Run: func(cmd *cobra.Command, args []string) {
			if len(args) < 2 {
				cmd.Help()
				return
			}
			b := create.New(args[0], args[1])
			b.AddSTIScripts()
			b.AddDockerfile()
			b.AddReadme()
			b.AddTests()
		},
	}
}
343610
func NewCmdVersion(out io.Writer) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "version",
		Short: "Print the version of kubeadm",
		Run: func(cmd *cobra.Command, args []string) {
			err := RunVersion(out, cmd)
			kubeadmutil.CheckErr(err)
		},
	}
	cmd.Flags().StringP("output", "o", "", "Output format; available options are 'yaml', 'json' and 'short'")
	return cmd
}
1198146
func NewVerifyMessageCmd(address, signature, message string) *VerifyMessageCmd {
	return &VerifyMessageCmd{
		Address:   address,
		Signature: signature,
		Message:   message,
	}
}
397485
func newCmdOptions() *cobra.Command {
	cmd := &cobra.Command{
		Use: "options",
		Run: func(cmd *cobra.Command, args []string) {
			cmd.Usage()
		},
	}

	ktemplates.UseOptionsTemplates(cmd)

	return cmd
}
1292172
func (s *ServiceSoftwareOptions) SetNewVersion(v string) *ServiceSoftwareOptions {
	s.NewVersion = &v
	return s
}
1114656
func NewCmd() *flaeg.Command {
	return &flaeg.Command{
		Name:                  "version",
		Description:           `Print version`,
		Config:                struct{}{},
		DefaultPointersConfig: struct{}{},
		Run: func() error {
			if err := GetPrint(os.Stdout); err != nil {
				return err
			}
			fmt.Print("\n")
			return nil

		},
	}
}