MCPcopy
hub / github.com/git-lfs/git-lfs / NewCommand

Function NewCommand

commands/run.go:31–33  ·  view source on GitHub ↗

NewCommand creates a new 'git-lfs' sub command, given a command name and command run function. Each command will initialize the local storage ('.git/lfs') directory when run, unless the PreRun hook is set to nil.

(name string, runFn func(*cobra.Command, []string))

Source from the content-addressed store, hash-verified

29// Each command will initialize the local storage ('.git/lfs') directory when
30// run, unless the PreRun hook is set to nil.
31func NewCommand(name string, runFn func(*cobra.Command, []string)) *cobra.Command {
32 return &cobra.Command{Use: name, Run: runFn, PreRun: setupHTTPLogger}
33}
34
35// RegisterCommand creates a direct 'git-lfs' subcommand, given a command name,
36// a command run function, and an optional callback during the command

Callers 7

initFunction · 0.85
initFunction · 0.85
initFunction · 0.85
RegisterCommandFunction · 0.85
RunFunction · 0.85
initFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected