Documentation
¶
Overview ¶
Copyright © 2024 Daniel Rivas <danielrivasmd@gmail.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 danielrivasmd@gmail.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Daniel Rivas <danielrivasmd@gmail.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Daniel Rivas <danielrivasmd@gmail.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 Daniel Rivas <danielrivasmd@gmail.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2024 danielrivasmd@gmail.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func Execute()
- func GetDocs() map[string]DocEntry
- func GetExample(key string) string
- func GetHelp(key string) string
- func GetShort(key string) string
- func GetUse(key string) string
- func MakeCmd(key string, run func(*cobra.Command, []string), opts ...CommandOpt) *cobra.Command
- type CommandOpt
- func WithAliases(aliases []string) CommandOpt
- func WithArgs(validator cobra.PositionalArgs) CommandOpt
- func WithDisableFlagParsing(disable bool) CommandOpt
- func WithPostRun(postRun func(*cobra.Command, []string)) CommandOpt
- func WithPreRun(preRun func(*cobra.Command, []string)) CommandOpt
- func WithSilenceErrors(silence bool) CommandOpt
- func WithSilenceUsage(silence bool) CommandOpt
- func WithValidArgs(args []string) CommandOpt
- type DocEntry
- type Docs
- func (d *Docs) CommandExists(key string) bool
- func (d *Docs) GetAllEntries() map[string]DocEntry
- func (d *Docs) GetEntry(key string) (DocEntry, bool)
- func (d *Docs) GetExample(key string) string
- func (d *Docs) GetHelp(key string) string
- func (d *Docs) GetShort(key string) string
- func (d *Docs) GetUse(key string) string
- func (d *Docs) ListCommands() []string
Constants ¶
const APP = "mbombo"
const EMAIL = "<danielrivasmd@gmail.com>"
const NAME = "Daniel Rivas"
const VERSION = "v1.0.0"
Variables ¶
This section is empty.
Functions ¶
func GetExample ¶
Types ¶
type CommandOpt ¶
func WithAliases ¶
func WithAliases(aliases []string) CommandOpt
func WithArgs ¶
func WithArgs(validator cobra.PositionalArgs) CommandOpt
func WithDisableFlagParsing ¶
func WithDisableFlagParsing(disable bool) CommandOpt
func WithPostRun ¶
func WithPostRun(postRun func(*cobra.Command, []string)) CommandOpt
func WithPreRun ¶
func WithPreRun(preRun func(*cobra.Command, []string)) CommandOpt
func WithSilenceErrors ¶
func WithSilenceErrors(silence bool) CommandOpt
func WithSilenceUsage ¶
func WithSilenceUsage(silence bool) CommandOpt
func WithValidArgs ¶
func WithValidArgs(args []string) CommandOpt
type DocEntry ¶
type DocEntry struct {
Use string `json:"use"`
Aliases []string `json:"aliases,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Short string `json:"short,omitempty"`
Long string `json:"long"`
ExampleUsages [][]string `json:"example_usages,omitempty"`
ValidArgs []string `json:"valid_args,omitempty"`
DisableFlagsInUseLine bool `json:"disable_flags_in_use_line,omitempty"`
}
func GetDocEntry ¶
type Docs ¶
type Docs struct {
// contains filtered or unexported fields
}