INNER CODE UNIT · Go

determineFullNameAndLevel

edgelesssys/constellation · hack/clidocgen/main.go:59

func determineFullNameAndLevel(cmd *cobra.Command) (string, int) {
	// Traverse the command tree upwards and determine the full name and level of the command.
	name := cmd.Name()
	level := 0
	for cmd.HasParent() && cmd.Parent().Name() != "constellation" {
		cmd = cmd.Parent()
		name = cmd.Name() + "-" + name // Use '-' as separator since we pipe it into a Markdown link.
		level++
	}
	return name, level
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…