-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package commandsnew | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bep/simplecobra" | ||
ck "github.com/bep/simplecobra" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func newConvertCommand() *convertCommand { | ||
return &convertCommand{ | ||
commands: []simplecobra.Commander{}, | ||
} | ||
|
||
} | ||
|
||
type convertCommand struct { | ||
r *rootCommand | ||
|
||
commands []ck.Commander | ||
} | ||
|
||
func (c *convertCommand) Commands() []simplecobra.Commander { | ||
return c.commands | ||
} | ||
|
||
func (c *convertCommand) Name() string { | ||
return "convert" | ||
} | ||
|
||
func (c *convertCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args []string) error { | ||
return nil | ||
} | ||
|
||
func (c *convertCommand) WithCobraCommand(cmd *cobra.Command) error { | ||
cmd.Short = "Print the site configuration" | ||
cmd.Long = `Print the site configuration, both default and custom settings.` | ||
return nil | ||
} | ||
|
||
func (c *convertCommand) Init(cd *simplecobra.Commandeer) error { | ||
c.r = cd.Root.Command.(*rootCommand) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Test the convert commands. | ||
|
||
hugo convert -h | ||
stdout 'asdfsdf' |