arguments

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDirectory

func GetDirectory(args []string) (string, error)

GetDirectory computes the absolute path from the input arguments.

When no argument has been specified, it return the current working directory.

func PackageTriple

func PackageTriple(c *cobra.Command, args []string) error

PackageTriple validates that the arguments are a triple package, version, and shasum.

It checks that there's a package name as first arguments, at least. It checks that there are no more that 3 arguments. It accepts a single version or versions constraints as the second argument, in which case the third one is ignored.

func PackageTripleActiveHelp

func PackageTripleActiveHelp(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective)

PackageTripleActiveHelp generates the active help for a triple package, version (or version constraint), and shasumxs.

func SingleDirectory

func SingleDirectory(c *cobra.Command, args []string) error

SingleDirectory validates the input arguments is a single directory.

It checks that there is maximum one argument. It checks that the argument is an existing directory, too.

func SingleDirectoryActiveHelp

func SingleDirectoryActiveHelp(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective)

SingleDirectoryActiveHelp generates the active help for a single directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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