about summary refs log tree commit diff stats
path: root/core/ports
Commit message (Expand)AuthorAgeFilesLines
* release revisionSilvino Silva2018-07-175-1002/+1010
* added nbd to kernelSilvino Silva2018-04-086-506/+979
* core fstab and linux-gnu port updatedSilvino Silva2018-04-063-410/+1801
* core linux kernel revisionSilvino Silva2018-03-082-2/+7
* core linux-gnu port updatedSilvino Silva2018-03-0814-5507/+1710
* core and tools revisionSilvino Silva2017-02-2712-482/+664
* core revisionSilvino Silva2017-02-2012-183/+186
* core ports correct linux-blob portSilvino Silva2017-02-1911-3833/+4898
* updated core ports kernel libreSilvino Silva2017-02-195-78/+96
* install update to crux 3.3Silvino Silva2017-02-189-525/+4984
* core revisionSilvino Silva2016-10-159-1007/+1007
* updated core linux ports and iptables scriptSilvino Silva2016-09-178-352/+4344
* core ports dracut missing Maintainer fieldSilvino Silva2016-09-151-1/+1
* updated core port linux from c9-portsSilvino Silva2016-09-151-5/+1
* dracut revisionSilvino Silva2016-09-154-5/+25
* linux crux updatedSilvino Silva2016-09-104-481/+282
* added patch to linux port, gcc optimizationsSilvino Silva2016-08-221-0/+2
* first doc core os revisionSilvino Silva2016-08-228-0/+4271
/* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
package main

import (
	"fmt"
	"os"
	"os/exec"
)

var (
	version = "v0.1.0"

	cmd   Config
	flags []string
)

func main() {
	initPledge()
	initUnveil()

	if len(os.Args) == 1 {
		fmt.Println("Usage: pavo <command> <flags>")
		os.Exit(1)
	}

	if os.Args[1] == "version" {
		fmt.Println("Pavo", version)
		os.Exit(0)
	}

	// Parse the config file.
	parseConfig()

	// Block futher unveil calls.
	blockUnveil()

	// Get path of command.
	cmdPath, err := exec.LookPath(cmd.Command)
	if err != nil {
		fmt.Printf("%s %s :: %s\n",
			cmd.Command,
			"not found in $PATH",
			err.Error())
		os.Exit(1)
	}

	// TODO: Make the output realtime.
	out, err := exec.Command(cmdPath, flags...).Output()
	if err != nil {
		err = fmt.Errorf("%s :: %s",
			"Failed to execute command",
			err.Error())
		os.Exit(1)
	}

	// Print the output.
	fmt.Printf(string(out))
}