Ejemplo n.º 1
0
func hwaf_make_cmd_asetup() *commander.Command {
	cmd := &commander.Command{
		Run:       hwaf_run_cmd_asetup,
		UsageLine: "asetup [options] <args>",
		Short:     "setup a workarea with Athena-like defaults",
		Long: `
asetup sets up a workarea with Athena-like defaults.

ex:
 $ mkdir my-work-area && cd my-work-area
 $ hwaf asetup
 $ hwaf asetup mana,20121207
 $ hwaf asetup mana 20121207
 $ hwaf asetup -arch=64    mana 20121207
 $ hwaf asetup -comp=gcc44 mana 20121207
 $ hwaf asetup -os=centos6 mana 20121207
 $ hwaf asetup -type=opt   mana 20121207
 $ hwaf asetup -cmtcfg=x86_64-slc6-gcc44-opt mana 20121207
 $ CMTCFG=x86_64-slc6-gcc44-opt \
   hwaf asetup mana 20121207
`,
		Flag: *flag.NewFlagSet("hwaf-setup", flag.ExitOnError),
	}
	//cmd.Flag.String("p", "", "List of paths to projects to setup against")
	//cmd.Flag.String("cfg", "", "Path to a configuration file")
	cmd.Flag.Bool("v", false, "enable verbose mode")
	cmd.Flag.String("arch", "", "explicit architecture to use (32/64)")
	cmd.Flag.String("comp", "", "explicit compiler name to use (ex: gcc44, clang32,...)")
	cmd.Flag.String("os", "", "explicit system name to use (ex: slc6, slc5, centos6, darwin106,...)")
	cmd.Flag.String("type", "", "explicit build variant to use (ex: opt/dbg)")
	cmd.Flag.String("cmtcfg", "", "explicit CMTCFG value to use")
	return cmd
}
Ejemplo n.º 2
0
Archivo: cmd.go Proyecto: hdonnay/aptly
// RootCommand creates root command in command tree
func RootCommand() *commander.Command {
	cmd := &commander.Command{
		UsageLine: os.Args[0],
		Short:     "Debian repository management tool",
		Long: `
aptly is a tool to create partial and full mirrors of remote
repositories, manage local repositories, filter them, merge,
upgrade individual packages, take snapshots and publish them
back as Debian repositories.`,
		Flag: *flag.NewFlagSet("aptly", flag.ExitOnError),
		Subcommands: []*commander.Command{
			makeCmdDb(),
			makeCmdGraph(),
			makeCmdMirror(),
			makeCmdRepo(),
			makeCmdServe(),
			makeCmdSnapshot(),
			makeCmdPublish(),
			makeCmdVersion(),
		},
	}

	cmd.Flag.Bool("dep-follow-suggests", false, "when processing dependencies, follow Suggests")
	cmd.Flag.Bool("dep-follow-source", false, "when processing dependencies, follow from binary to Source packages")
	cmd.Flag.Bool("dep-follow-recommends", false, "when processing dependencies, follow Recommends")
	cmd.Flag.Bool("dep-follow-all-variants", false, "when processing dependencies, follow a & b if depdency is 'a|b'")
	cmd.Flag.String("architectures", "", "list of architectures to consider during (comma-separated), default to all available")
	cmd.Flag.String("config", "", "location of configuration file (default locations are /etc/aptly.conf, ~/.aptly.conf)")
	return cmd
}
Ejemplo n.º 3
0
func hwaf_make_cmd_git_svn_clone() *commander.Command {
	cmd := &commander.Command{
		Run:       hwaf_run_cmd_git_svn_clone,
		UsageLine: "svn-clone [options] <URL>",
		Short:     "convert a SVN repository into a GIT one",
		Long: `
svn-clone converts a SVN repository into a GIT one.

ex:
 $ hwaf git svn-clone svn+ssh://svn.cern.ch/atlasoff/Control/AthenaCommon
`,
		Flag: *flag.NewFlagSet("hwaf-git-svn-clone", flag.ExitOnError),
	}
	cmd.Flag.Bool("verbose", false, "")
	cmd.Flag.Bool("metadata", false, "include metadata in git logs (git-svn-id)")
	cmd.Flag.Bool("no-minimize-url", false, "accept URLs as-is without attempting to connect a higher level directory")
	cmd.Flag.Bool("root-is-trunk", false, "use this if the root level of the repo is equivalent to the trunk and there are no tags or branches")
	cmd.Flag.Bool("rebase", false, "instead of cloning a new project, rebase an existing one against SVN")
	cmd.Flag.String("username", "", "username for transports that needs it (http(s), svn)")
	cmd.Flag.String("trunk", "trunk", "subpath to trunk from repository URL")
	cmd.Flag.String("branches", "branches", "subpath to branches from repository URL")
	cmd.Flag.String("tags", "tags", "subpath to tags from repository URL")
	cmd.Flag.String("exclude", "", "regular expression to filter paths when fetching")
	cmd.Flag.String("revision", "", "start importing from SVN revision START_REV; optionally end at END_REV. e.g. -revision START_REV:END_REV")

	cmd.Flag.Bool("no-trunk", false, "do not import anything from trunk")
	cmd.Flag.Bool("no-branches", false, "do not import anything from branches")
	cmd.Flag.Bool("no-tags", false, "do not import anything from tags")
	cmd.Flag.String("authors", "$HOME/.config/go-svn2git/authors", "path to file containing svn-to-git authors mapping")
	return cmd
}
Ejemplo n.º 4
0
func hwaf_make_cmd_pkg_add() *commander.Command {
	cmd := &commander.Command{
		Run:       hwaf_run_cmd_pkg_add,
		UsageLine: "co [options] <pkg-uri> [<local-pkg-name>]",
		Short:     "add a package to the current workarea",
		Long: `
co adds a package to the current workarea.

ex:
 $ hwaf pkg co /foo/pkg
 $ hwaf pkg co Control/AthenaKernel
 $ hwaf pkg co git://github.com/mana-fwk/mana-core-athenakernel
 $ hwaf pkg co git://github.com/mana-fwk/mana-core-athenakernel Control/AthenaKernel
 $ hwaf pkg co -b=rel/mana git://github.com/mana-fwk/mana-core-athenakernel Control/AthenaKernel
 $ hwaf pkg co -b=AthenaKernel-00-00-01 svn+ssh://svn.cern.ch/reps/atlasoff/Control/AthenaKernel Control/AthenaKernel
 $ hwaf pkg co -f=list.of.pkgs.txt
`,
		Flag: *flag.NewFlagSet("hwaf-pkg-co", flag.ExitOnError),
	}
	cmd.Flag.Bool("v", false, "enable verbose output")
	cmd.Flag.String("b", "", "branch to checkout (default=master)")
	cmd.Flag.String("f", "", "path to a file holding a list of packages to retrieve")

	return cmd
}
Ejemplo n.º 5
0
Archivo: cmd.go Proyecto: sbinet/go-ami
func ami_make_cmd_cmd() *commander.Command {
	cmd := &commander.Command{
		Run:       run_any_cmd,
		UsageLine: "cmd <AmiCommand> <AmiArg0> <AmiArg1>...",
		Short:     "run an arbitrary AMI command",
		Long: `
cmd sends an arbitrary AMI command to the AMI server.

ex:

$ go-ami cmd TCGetPackageInfo fullPackageName="/External/pyAMI" processingStep="production" project="TagCollector" repositoryName="AtlasOfflineRepository"

row=0
  -> computingDescription=0
  -> created=2012-08-31 15:41:53 +0000 UTC
  -> physicsDescription=
  -> archive=0
  -> groupOriginOfPackage=AtlasRelease
  -> fullPackageName=/External/pyAMI
  -> comment=
  -> packageName=pyAMI
  -> repositoryName=AtlasOfflineRepository
  -> path=/External/
  -> softwareDomain=
  -> defaultType=leaf
row=1
 [...]
`,
		Flag: *flag.NewFlagSet("ami-cmd", flag.ExitOnError),
	}
	return cmd
}
Ejemplo n.º 6
0
func fwk_make_cmd_run() *commander.Command {
	cmd := &commander.Command{
		Run:       fwk_run_cmd_run,
		UsageLine: "run [options] <config.go> [<config2.go> [...]]",
		Short:     "run a fwk job",
		Long: `
run runs a fwk-based job.

ex:
 $ fwk-app run config.go
 $ fwk-app run config1.go config2.go
 $ fwk-app run ./some-dir
 $ fwk-app run -l=INFO -nprocs=4 -evtmax=-1 config.go
`,
		Flag: *flag.NewFlagSet("fwk-app-run", flag.ExitOnError),
	}

	cmd.Flag.String("o", "", "name of the resulting binary (default=name of parent directory)")
	cmd.Flag.Bool("k", false, "whether to keep the resulting binary after a successful run")

	// flags passed to sub-process
	cmd.Flag.String("l", "INFO", "log level (DEBUG|INFO|WARN|ERROR)")
	cmd.Flag.Int("evtmax", -1, "number of events to process")
	cmd.Flag.Int("nprocs", 0, "number of concurrent events to process")
	cmd.Flag.Bool("cpu-prof", false, "enable CPU profiling")
	return cmd
}
Ejemplo n.º 7
0
func hwaf_make_cmd_setup() *commander.Command {
	cmd := &commander.Command{
		Run:       hwaf_run_cmd_setup,
		UsageLine: "setup [options] <workarea>",
		Short:     "setup an existing workarea",
		Long: `
setup sets up an existing workarea.

ex:
 $ hwaf setup
 $ hwaf setup .
 $ hwaf setup my-work-area
 $ hwaf setup -p=/opt/sw/mana/mana-core/20121207 my-work-area
 $ hwaf setup -p=/path1:/path2 my-work-area
 $ hwaf setup -cfg=${HWAF_CFG}/usr.cfg my-work-area
 $ hwaf setup -tags=ATLAS,NEED_PYCOOL my-work-area
 $ hwaf setup -variant=x86_64-slc6-gcc47-opt my-work-area
`,
		Flag: *flag.NewFlagSet("hwaf-setup", flag.ExitOnError),
	}
	cmd.Flag.String("p", "", "List of paths to projects to setup against")
	cmd.Flag.String("cfg", "", "Path to a configuration file")
	cmd.Flag.String("pkgdir", "src", "Directory under which to checkout packages")
	cmd.Flag.String("variant", "", "quadruplet (e.g. x86_64-slc6-gcc47-opt) identifying the target to build for")
	cmd.Flag.String("tags", "", "comma-separated list of tags to enable for this build")
	cmd.Flag.Bool("v", false, "enable verbose output")

	return cmd
}
Ejemplo n.º 8
0
func init() {
	app = &commander.Command{
		UsageLine:   "jupyter",
		Subcommands: nil,
		Flag:        *flag.NewFlagSet("jupyter", flag.ExitOnError),
	}
}
Ejemplo n.º 9
0
func main() {

	g_cmd = &commander.Command{
		UsageLine: "go-ami",
		Subcommands: []*commander.Command{
			ami_make_cmd_cmd(),
			ami_make_list_datasets_cmd(),
			ami_make_list_runs_cmd(),
			ami_make_list_projects_cmd(),
			ami_make_setup_auth_cmd(),
		},
		Flag: *flag.NewFlagSet("ami", flag.ExitOnError),
	}
	g_cmd.Flag.Bool("verbose", false, "show verbose output")
	g_cmd.Flag.Bool("debug", false, "show a stack trace")
	g_cmd.Flag.String("format", "text", "format of verbose output")
	g_cmd.Flag.Int("n", 5, "number of concurrent queries")

	//TODO: check the value *is* in the [main,replica] list via a special
	//      flag.Value implementation ?
	g_cmd.Flag.String("server", "main", "set the server (main, replica)")

	err := g_cmd.Flag.Parse(os.Args[1:])
	if err != nil {
		fmt.Printf("**error** %v\n", err)
		os.Exit(1)
	}
	g_ami, err = ami.NewClient(
		g_cmd.Flag.Lookup("verbose").Value.Get().(bool),
		g_cmd.Flag.Lookup("format").Value.Get().(string),
		g_cmd.Flag.Lookup("n").Value.Get().(int),
	)
	server := g_cmd.Flag.Lookup("server").Value.Get().(string)
	if server != "main" && server != "replica" {
		fmt.Printf("**error**. server has to be either 'main' or 'replica' (got: %q)\n", server)
		os.Exit(1)
	}
	ami.EndPointType = server

	args := g_cmd.Flag.Args()

	if g_cmd.Flag.Lookup("verbose").Value.Get().(bool) {
		fmt.Printf("%s: server=%v\n", g_cmd.Name, g_cmd.Flag.Lookup("server").Value)
		fmt.Printf("%s: args=%v\n", g_cmd.Name, args)
	}
	if len(args) > 0 && args[0] != "help" && args[0] != "setup-auth" {
		if err != nil {
			fmt.Printf("**error** could not create ami.Client: %v\n", err)
			if err == ami.ErrAuth {
				fmt.Printf("**error** try running:\n  go-ami setup-auth\n")
			}
			os.Exit(1)
		}
	}
	err = g_cmd.Dispatch(args)
	if err != nil {
		fmt.Printf("**error** %v\n", err)
		os.Exit(1)
	}
}
Ejemplo n.º 10
0
func init() {
	g_cmd = &commander.Command{
		UsageLine: "lbpkr",
		Short:     "installs software in MYSITEROOT directory.",
		Subcommands: []*commander.Command{
			lbpkr_make_cmd_check(),
			lbpkr_make_cmd_deps(),
			lbpkr_make_cmd_dep_graph(),
			lbpkr_make_cmd_install(),
			lbpkr_make_cmd_install_project(),
			lbpkr_make_cmd_installed(),
			lbpkr_make_cmd_list(),
			lbpkr_make_cmd_provides(),
			lbpkr_make_cmd_remove(),
			lbpkr_make_cmd_repo_add(),
			lbpkr_make_cmd_repo_ls(),
			lbpkr_make_cmd_repo_rm(),
			lbpkr_make_cmd_rpm(),
			lbpkr_make_cmd_self(),
			lbpkr_make_cmd_update(),
			lbpkr_make_cmd_version(),
		},
		Flag: *flag.NewFlagSet("lbpkr", flag.ContinueOnError),
	}
}
Ejemplo n.º 11
0
func main() {

	g_cmd = &commander.Commander{
		Name: os.Args[0],
		Commands: []*commander.Command{
			git_make_cmd_create(),
			git_make_cmd_login(),
			git_make_cmd_dl_create(),
			git_make_cmd_dl_ls(),
			git_make_cmd_dl_rm(),
		},
		Flag: flag.NewFlagSet("goctogit", flag.ExitOnError),
	}

	err := g_cmd.Flag.Parse(os.Args[1:])
	if err != nil {
		fmt.Printf("**error** %v\n", err)
		os.Exit(1)
	}

	args := g_cmd.Flag.Args()
	err = g_cmd.Run(args)
	if err != nil {
		fmt.Printf("**error** %v\n", err)
		os.Exit(1)
	}
}
Ejemplo n.º 12
0
func init() {
	g_cmd = &commander.Commander{
		Name: os.Args[0],
		Commands: []*commander.Command{
			generate(),
		},
		Flag: flag.NewFlagSet("gobot-cli", flag.ExitOnError),
	}
}
Ejemplo n.º 13
0
func init() {
	g_cmd = &commander.Command{
		UsageLine: "gobot <command>",
		Subcommands: []*commander.Command{
			generate(),
		},
		Flag: *flag.NewFlagSet("gobot", flag.ExitOnError),
	}
}
Ejemplo n.º 14
0
func makeRemoveCmd() *commander.Command {
	var removeCmd = &commander.Command{
		Run:       runRemoveCmd,
		UsageLine: "remove <name>",
		Flag:      *flag.NewFlagSet("mezasi-remove", flag.ExitOnError),
	}
	removeCmd.Flag.Bool("yes", false, "")
	return removeCmd
}
Ejemplo n.º 15
0
func makeDestroyCmd() *commander.Command {
	var removeCmd = &commander.Command{
		Run:       runDestroyCmd,
		UsageLine: "destroy <subid>",
		Flag:      *flag.NewFlagSet("vultr-destroy", flag.ExitOnError),
	}
	removeCmd.Flag.Bool("yes", false, "")
	return removeCmd
}
Ejemplo n.º 16
0
func init() {
	g_cmd = &commander.Commander{
		Name: os.Args[0],
		Commands: []*commander.Command{
			acvmfs_make_cmd_pkg_create(),
		},
		Flag:       flag.NewFlagSet("acvmfs", flag.ExitOnError),
		Commanders: []*commander.Commander{},
	}
}
Ejemplo n.º 17
0
func init() {
	a2cmd = &commander.Commander{
		Name: os.Args[0],
		Commands: []*commander.Command{
			cmdDisasm,
			cmdDiskConvert,
		},
		Flag: flag.NewFlagSet("a2", flag.ExitOnError),
	}
}
Ejemplo n.º 18
0
Archivo: main.go Proyecto: sbinet/aptly
func init() {
	cmd = &commander.Commander{
		Name:     os.Args[0],
		Commands: []*commander.Command{},
		Flag:     flag.NewFlagSet("aptly", flag.ExitOnError),
		Commanders: []*commander.Commander{
			makeCmdMirror(),
		},
	}
}
Ejemplo n.º 19
0
func init() {
	app = &commander.Command{
		UsageLine: "gopy",
		Subcommands: []*commander.Command{
			gopyMakeCmdGen(),
			gopyMakeCmdBind(),
		},
		Flag: *flag.NewFlagSet("gopy", flag.ExitOnError),
	}
}
Ejemplo n.º 20
0
func makeCmdDb() *commander.Command {
	return &commander.Command{
		UsageLine: "db",
		Short:     "manage aptly's internal database and package pool",
		Subcommands: []*commander.Command{
			makeCmdDbCleanup(),
		},
		Flag: *flag.NewFlagSet("aptly-db", flag.ExitOnError),
	}
}
Ejemplo n.º 21
0
func alto_make_cmd_market() *commander.Commander {
	cmd := &commander.Commander{
		Name:  "market",
		Short: "interact with the marketplace",
		Commands: []*commander.Command{
			alto_make_cmd_market_ls(),
		},
		Flag: flag.NewFlagSet("alto-market", flag.ExitOnError),
	}
	return cmd
}
Ejemplo n.º 22
0
func init() {
	g_cmd = &commander.Command{
		UsageLine: "fwk-app <sub-command> [options] [args [...]]",
		Short:     "builds and runs fwk-based applications",
		Subcommands: []*commander.Command{
			fwk_make_cmd_run(),
			fwk_make_cmd_build(),
		},
		Flag: *flag.NewFlagSet("fwk-app", flag.ExitOnError),
	}
}
Ejemplo n.º 23
0
func hwaf_make_cmd_pmgr() *commander.Command {
	cmd := &commander.Command{
		UsageLine: "pmgr [options]",
		Short:     "query, download and install projects",
		Subcommands: []*commander.Command{
			hwaf_make_cmd_pmgr_get(),
		},
		Flag: *flag.NewFlagSet("hwaf-pmgr", flag.ExitOnError),
	}
	return cmd
}
Ejemplo n.º 24
0
func hwaf_make_cmd_pmgr() *commander.Commander {
	cmd := &commander.Commander{
		Name:  "pmgr",
		Short: "query, download and install projects",
		Commands: []*commander.Command{
			hwaf_make_cmd_pmgr_get(),
		},
		Flag: flag.NewFlagSet("hwaf-pmgr", flag.ExitOnError),
	}
	return cmd
}
Ejemplo n.º 25
0
func makeCmdPublish() *commander.Command {
	return &commander.Command{
		UsageLine: "publish",
		Short:     "manage published repositories",
		Subcommands: []*commander.Command{
			makeCmdPublishSnapshot(),
			makeCmdPublishList(),
			makeCmdPublishDrop(),
		},
		Flag: *flag.NewFlagSet("aptly-publish", flag.ExitOnError),
	}
}
Ejemplo n.º 26
0
Archivo: cmd_git.go Proyecto: hwaf/hwaf
func hwaf_make_cmd_git() *commander.Command {
	cmd := &commander.Command{
		UsageLine: "git [options]",
		Short:     "hwaf related git tools",
		Subcommands: []*commander.Command{
			hwaf_make_cmd_git_rm_submodule(),
			hwaf_make_cmd_git_svn_clone(),
		},
		Flag: *flag.NewFlagSet("hwaf-git", flag.ExitOnError),
	}
	return cmd
}
Ejemplo n.º 27
0
func makeCreateCmd() *commander.Command {
	var createCmd = &commander.Command{
		Run:       runCreateCmd,
		UsageLine: "create [options]",
		Flag:      *flag.NewFlagSet("vultr-create", flag.ExitOnError),
	}

	createCmd.Flag.String("osid", "", "os id (* required)")
	createCmd.Flag.String("dcid", "", "regions id (* required)")
	createCmd.Flag.String("vpsplanid", "", "plan id (* required)")
	return createCmd
}
Ejemplo n.º 28
0
func alto_make_cmd_disk() *commander.Commander {
	cmd := &commander.Commander{
		Name:  "disk",
		Short: "add/remove/list persistent disks",
		Commands: []*commander.Command{
			alto_make_cmd_disk_add(),
			alto_make_cmd_disk_ls(),
		},
		Flag: flag.NewFlagSet("alto-disk", flag.ExitOnError),
	}
	return cmd
}
Ejemplo n.º 29
0
func ex_make_cmd_subcmd1() *commander.Commander {
	cmd := &commander.Commander{
		Name:  "subcmd1",
		Short: "subcmd1 sub-commander. does subcmd1 thingies",
		Commands: []*commander.Command{
			ex_make_cmd_subcmd1_cmd1(),
			ex_make_cmd_subcmd1_cmd2(),
		},
		Flag: flag.NewFlagSet("my-cmd-subcmd1", flag.ExitOnError),
	}
	return cmd
}
Ejemplo n.º 30
0
func hwaf_make_cmd_git() *commander.Commander {
	cmd := &commander.Commander{
		Name:  "git",
		Short: "hwaf related git tools",
		Commands: []*commander.Command{
			hwaf_make_cmd_git_rm_submodule(),
			hwaf_make_cmd_git_svn_clone(),
		},
		Flag: flag.NewFlagSet("hwaf-git", flag.ExitOnError),
	}
	return cmd
}