-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'opiproject:main' into nm-dbus
- Loading branch information
Showing
27 changed files
with
261 additions
and
92 deletions.
There are no files selected for viewing
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,26 @@ | ||
<!-- Thanks for sending a pull request! --> | ||
|
||
## Proposed changes | ||
|
||
Summarize your changes here to communicate with the maintainers and make sure to put the link of that issue | ||
|
||
## Types of changes | ||
|
||
What types of changes does your code introduce to the repo? Put an `x` in the boxes that apply | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Bugfix (non-breaking change which fixes an issue) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] Documentation Update (if none of the other choices applies) | ||
|
||
## Checklist | ||
|
||
Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code. | ||
- [ ] I have signed the commit for DCO to be passed. | ||
- [ ] Lint and unit tests pass locally with my changes | ||
- [ ] I have added tests that prove my fix is effective or that my feature works (if appropriate) | ||
- [ ] I have added necessary documentation (if appropriate) | ||
|
||
## Dependency | ||
- Please add the links to the dependent PR need to be merged before this (if any). | ||
|
||
## Special notes for your reviewer: |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,33 @@ | ||
package cmd | ||
|
||
import ( | ||
"log" | ||
"os" | ||
|
||
"github.com/TwiN/go-color" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// commands hold a slice of all cobra commands for cli tool | ||
var commands []*cobra.Command | ||
|
||
// RootCmd is the main entrypoint for the cli | ||
func RootCmd() *cobra.Command { | ||
c := &cobra.Command{ | ||
Use: "opi-sztp-agent", | ||
Short: "opi-sztp-agent is the agent command line interface to work with the sztp workflow", | ||
Run: func(cmd *cobra.Command, _ []string) { | ||
err := cmd.Help() | ||
if err != nil { | ||
log.Fatalf(color.InRed("[ERROR]")+"%s", err.Error()) | ||
} | ||
os.Exit(1) | ||
}, | ||
} | ||
|
||
for _, cmd := range commands { | ||
c.AddCommand(cmd) | ||
} | ||
|
||
return c | ||
} |
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
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
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
Oops, something went wrong.