job

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Edit = app.Register(&app.Command[app.Empty, app.Empty]{
	Use:    "job {job}",
	Desc:   "Edit job file",
	Action: "Edit",

	PrepareNoFlag: func(cmd *cobra.Command) {
		cmd.Args = cobra.ExactArgs(1)
		cmd.ValidArgsFunction = app.Comp(app.CompJob)
	},

	Run: func(ctx *app.Context[app.Empty, app.Empty]) error {
		name := fmt.Sprintf("%s.sh", ctx.Arg(0))
		path := config.GetDir("jobs", name)
		return app.Edit(path, "", name, nil)
	},
})
View Source
var Job = app.Register(&app.Command[app.Empty, app.Empty]{
	Use:    "job {name}",
	Desc:   "Delete a job",
	Action: "Delete",

	PrepareNoFlag: func(cmd *cobra.Command) {
		cmd.Args = cobra.ExactArgs(1)
		cmd.ValidArgsFunction = app.Comp(app.CompJob)
	},

	Run: func(ctx *app.Context[app.Empty, app.Empty]) error {
		name := ctx.Arg(0)
		path := config.GetDir("jobs", name+".sh")
		return app.Delete(ctx.Arg(0), path)
	},
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL