internal/command: demote modulePath() export (#617)

Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
This commit is contained in:
Lars Lehtonen 2023-09-29 02:23:50 -07:00 committed by GitHub
parent 92abeb27eb
commit 6cd1c00e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 13 additions and 13 deletions

View File

@ -43,7 +43,7 @@ func (m *Meta) completePredictWorkspaceName() complete.Predictor {
// directory, since we don't have enough context to know where to
// find any config path argument, and it might be _after_ the argument
// we're trying to complete here anyway.
configPath, err := ModulePath(nil)
configPath, err := modulePath(nil)
if err != nil {
return nil
}

View File

@ -50,7 +50,7 @@ is configured to use a non-local backend. This backend doesn't support this
operation.
`
// ModulePath returns the path to the root module and validates CLI arguments.
// modulePath returns the path to the root module and validates CLI arguments.
//
// This centralizes the logic for any commands that previously accepted
// a module path via CLI arguments. This will error if any extraneous arguments
@ -58,7 +58,7 @@ operation.
//
// If your command accepts more than one arg, then change the slice bounds
// to pass validation.
func ModulePath(args []string) (string, error) {
func modulePath(args []string) (string, error) {
// TODO: test
if len(args) > 0 {

View File

@ -35,7 +35,7 @@ func (c *ConsoleCommand) Run(args []string) int {
return 1
}
configPath, err := ModulePath(cmdFlags.Args())
configPath, err := modulePath(cmdFlags.Args())
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -35,7 +35,7 @@ func (c *GetCommand) Run(args []string) int {
ctx, done := c.InterruptibleContext(c.CommandContext())
defer done()
path, err := ModulePath(cmdFlags.Args())
path, err := modulePath(cmdFlags.Args())
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -42,7 +42,7 @@ func (c *GraphCommand) Run(args []string) int {
return 1
}
configPath, err := ModulePath(cmdFlags.Args())
configPath, err := modulePath(cmdFlags.Args())
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -100,7 +100,7 @@ func (c *InitCommand) Run(args []string) int {
// Validate the arg count and get the working directory
args = cmdFlags.Args()
path, err := ModulePath(args)
path, err := modulePath(args)
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -41,7 +41,7 @@ func (c *ProvidersCommand) Run(args []string) int {
return 1
}
configPath, err := ModulePath(cmdFlags.Args())
configPath, err := modulePath(cmdFlags.Args())
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -44,7 +44,7 @@ func (c *UnlockCommand) Run(args []string) int {
// assume everything is initialized. The user can manually init if this is
// required.
configPath, err := ModulePath(args)
configPath, err := modulePath(args)
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -46,7 +46,7 @@ func (c *WorkspaceDeleteCommand) Run(args []string) int {
return cli.RunResultHelp
}
configPath, err := ModulePath(args[1:])
configPath, err := modulePath(args[1:])
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -30,7 +30,7 @@ func (c *WorkspaceListCommand) Run(args []string) int {
}
args = cmdFlags.Args()
configPath, err := ModulePath(args)
configPath, err := modulePath(args)
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -61,7 +61,7 @@ func (c *WorkspaceNewCommand) Run(args []string) int {
return 1
}
configPath, err := ModulePath(args[1:])
configPath, err := modulePath(args[1:])
if err != nil {
c.Ui.Error(err.Error())
return 1

View File

@ -37,7 +37,7 @@ func (c *WorkspaceSelectCommand) Run(args []string) int {
return cli.RunResultHelp
}
configPath, err := ModulePath(args[1:])
configPath, err := modulePath(args[1:])
if err != nil {
c.Ui.Error(err.Error())
return 1