diff --git a/Cargo.toml b/Cargo.toml index 5ac6138..123a668 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtasktic" -version = "0.3.0" +version = "0.4.0" authors = ["Jones Magloire @Joxit"] description = "Command-line task management tool for execution of regular long sequential or parallel tasks." edition = "2018" @@ -17,6 +17,6 @@ structopt = "^0.3" yaml-rust = "^0.4" linked-hash-map = "^0.5" libc = "^0.2" -attohttpc = "^0.15" +attohttpc = "^0.17" openssl = { version = "^0.10", features = ["vendored"] } json = "^0.12" diff --git a/README.md b/README.md index e79fc64..d2c9901 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Describe your tasks in a YAML file, execute all of them with runtasktic in foreg ## CLI ``` -runtasktic 0.2.0 +runtasktic 0.4.0 Jones Magloire @Joxit Command-line task management tool for execution of regular long sequential or parallel tasks. @@ -30,34 +30,40 @@ FLAGS: -V, --version Prints version information SUBCOMMANDS: - dot Export the configuration to a graph (needs graphviz/dot) - exec Execute a single command with notification - help Prints this message or the help of the given subcommand(s) - run Run tasks + completion Generate completion script for your shell + dot Export the configuration to a graph (needs graphviz/dot) + exec Execute a single command with notification + help Prints this message or the help of the given subcommand(s) + run Run tasks ``` ### Run: all tasks of a configuration file ``` -runtasktic-run 0.2.0 +runtasktic-run 0.4.0 Run tasks USAGE: - runtasktic run [FLAGS] + runtasktic run [FLAGS] [OPTIONS] [--] [config]... FLAGS: -b, --background Run the task in background -h, --help Prints help information -V, --version Prints version information +OPTIONS: + -s, --start ... Override the starting task if the job had already been started before. When using many + configuration files, start states must be in the first configuration file. Can be many + task ids with comma separated values + ARGS: - Configuration path (YAML) + ... Configurations path (YAML) ``` ### Exec: Simple command, just like nohup with notification ``` -runtasktic-exec 0.2.0 +runtasktic-exec 0.4.0 Execute a single command with notification USAGE: @@ -70,6 +76,7 @@ FLAGS: OPTIONS: -c, --config Configuration path (YAML) + -t, --task Run a single task from the configuration file ARGS: ... Command to execute @@ -78,7 +85,7 @@ ARGS: ### Dot: Create a graph using graphviz of your configuration file ``` -runtasktic-dot 0.2.0 +runtasktic-dot 0.4.0 Export the configuration to a graph (needs graphviz/dot) USAGE: @@ -93,6 +100,28 @@ ARGS: Path for the image. `dot` command is required ``` +### Completion: Generate completion script for your shell + +``` +runtasktic-completion 0.4.0 +Generate completion script for your shell + +USAGE: + runtasktic completion + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +SUBCOMMANDS: + bash Generates a .bash completion file for the Bourne Again SHell (BASH). Save the output in + `/etc/bash_completion.d/runtasktic` or `~/.local/share/bash-completion/completions/runtasktic` + elvish Generates a completion file for Elvish + fish Generates a .fish completion file for the Friendly Interactive SHell (fish) + help Prints this message or the help of the given subcommand(s) + zsh Generates a completion file for the Z SHell (ZSH) +``` + ## Configuration ```yaml diff --git a/src/commands/run.rs b/src/commands/run.rs index db3a45f..ca3f2d9 100644 --- a/src/commands/run.rs +++ b/src/commands/run.rs @@ -32,6 +32,12 @@ impl Run { } } + if self.config.is_empty() { + let clap = crate::Runtasktic::clap(); + let args = format!("{} run --help", clap.get_name()); + clap.get_matches_from(args.split(" ")); + } + if self.background && unsafe { fork() } != 0 { // The main process should return return;