func CanonCommand(runtime *program.SubRuntime) (retval int, err string) {
	argc := runtime.Argc
	argv := runtime.Argv

	var lines []repos.CanLine
	var e error

	if argc == 2 {
		// if we have two argument, use the specific specification given
		lines = append(lines, repos.CanLine{Pattern: "", Canonical: argv[1]})
	} else {
		// else read the canon file
		lines, e = program.GetCanonOrPanic()
		if e != nil {
			err = constants.StringInvalidCanfile
			retval = constants.ErrorMissingConfig
			return
		}

	}

	// print the canonical url or error
	return printCanonOrError(lines, argv[0])
}
// CanonCommand is the entry point for the canon command
CanonCommand is the entry point for the canon command
// CanonCommand is the entry point for the canon command
func CanonCommand(runtime *program.SubRuntime) (retval int, err string) {
	argc := runtime.Argc
	argv := runtime.Argv
	var lines []repos.CanLine
	var e error
	if argc == 2 {
		lines = append(lines, repos.CanLine{Pattern: "", Canonical: argv[1]})
	} else {
		lines, e = program.GetCanonOrPanic()
		if e != nil {
			err = constants.StringInvalidCanfile
			retval = constants.ErrorMissingConfig
			return
		}
	}
	return printCanonOrError(lines, argv[0])
}
func CanonCommand ( runtime * program . SubRuntime ) ( retval int , err string ) { argc := runtime . Argc argv := runtime . Argv var lines [ ] repos . CanLine var e error if argc == 2 { lines = append ( lines , repos . CanLine { Pattern : " " , Canonical : argv [ 1 ] } ) } else { lines , e = program . GetCanonOrPanic ( ) if e != nil { err = constants . StringInvalidCanfile retval = constants . ErrorMissingConfig return } } return printCanonOrError ( lines , argv [ 0 ] ) }
CanonCommand is the entry point for the canon command
CanonCommand is the entry point for the canon command
// if we have two argument, use the specific specification given // else read the canon file // print the canonical url or error